diff options
author | Bryn M. Reeves | 2010-02-18 21:39:22 +0100 |
---|---|---|
committer | Karel Zak | 2010-02-18 21:41:58 +0100 |
commit | 5ac78ead3c02660a894ca7e7a4887ce80ebe2b50 (patch) | |
tree | e58e2fd40ebc8930eae9245557591e55d6d947e8 /fdisk/sfdisk.c | |
parent | blkid: export ID_PART_ENTRY_* variables for udev (diff) | |
download | kernel-qcow2-util-linux-5ac78ead3c02660a894ca7e7a4887ce80ebe2b50.tar.gz kernel-qcow2-util-linux-5ac78ead3c02660a894ca7e7a4887ce80ebe2b50.tar.xz kernel-qcow2-util-linux-5ac78ead3c02660a894ca7e7a4887ce80ebe2b50.zip |
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>
Diffstat (limited to 'fdisk/sfdisk.c')
-rw-r--r-- | fdisk/sfdisk.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c index 6ac91f07b..6432b25c0 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; } |