From: Bryn M. Reeves Date: Thu, 18 Feb 2010 20:39:22 +0000 (+0100) Subject: sfdisk: make sure writes make it to disk in write_partitions() X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c54149e0510a3a088f726c8a1d74161faf6e8479;p=util-linux sfdisk: make sure writes make it to disk in write_partitions() Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=565946 Signed-off-by: Bryn M. Reeves Signed-off-by: Karel Zak --- diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c index 6ac91f07..6432b25c 100644 --- a/fdisk/sfdisk.c +++ b/fdisk/sfdisk.c @@ -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; }