From 5ac78ead3c02660a894ca7e7a4887ce80ebe2b50 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Thu, 18 Feb 2010 21:39:22 +0100 Subject: [PATCH] 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 --- fdisk/sfdisk.c | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.39.5