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 <bmr@errorists.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Bryn M. Reeves 2010-02-18 21:39:22 +01:00 committed by Karel Zak
parent 4f74ffdbfe
commit 5ac78ead3c
1 changed files with 5 additions and 0 deletions

View 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;
}