]> err.no Git - util-linux/commitdiff
sfdisk: make sure writes make it to disk in write_partitions()
authorBryn M. Reeves <bmr@errorists.org>
Thu, 18 Feb 2010 20:39:22 +0000 (21:39 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 18 Feb 2010 20:41:58 +0000 (21:41 +0100)
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=565946
Signed-off-by: Bryn M. Reeves <bmr@errorists.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
fdisk/sfdisk.c

index 6ac91f07b2ef5c599265b565190ce6e2dfdfe5ae..6432b25c05b08f7a3f7bac1187c11ce48193936d 100644 (file)
@@ -1637,6 +1637,11 @@ write_partitions(char *dev, int fd, struct disk_desc *z) {
        error(_("Failed writing the partition on %s\n"), dev);
        return 0;
     }
+    if (fsync(fd)) {
+       perror(dev);
+       error(_("Failed writing the partition on %s\n"), dev);
+       return 0;
+    }
     return 1;
 }