diff options
author | Karel Zak | 2013-05-20 13:10:52 +0200 |
---|---|---|
committer | Karel Zak | 2013-05-20 13:10:52 +0200 |
commit | 4df7954d47e08aabae993e7fe0193f08c83b2ff0 (patch) | |
tree | 48d632f21d7491c9936e281ddeade68cb6277a8b /fdisks | |
parent | uuidd: clean up error messages (diff) | |
download | kernel-qcow2-util-linux-4df7954d47e08aabae993e7fe0193f08c83b2ff0.tar.gz kernel-qcow2-util-linux-4df7954d47e08aabae993e7fe0193f08c83b2ff0.tar.xz kernel-qcow2-util-linux-4df7954d47e08aabae993e7fe0193f08c83b2ff0.zip |
sfdisk: don't call BLKRRPART for non-block devices
Reported-by: Bertrand Jacquin <beber@meleeweb.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisks')
-rw-r--r-- | fdisks/sfdisk.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fdisks/sfdisk.c b/fdisks/sfdisk.c index 27f62d816..e639dadeb 100644 --- a/fdisks/sfdisk.c +++ b/fdisks/sfdisk.c @@ -787,15 +787,17 @@ reread_ioctl(int fd) { /* reread after writing */ static int reread_disk_partition(char *dev, int fd) { - printf(_("Re-reading the partition table ...\n")); fflush(stdout); sync(); - if (reread_ioctl(fd) && is_blkdev(fd)) { - warnx(_("The command to re-read the partition table failed.\n" + if (is_blkdev(fd)) { + printf(_("Re-reading the partition table ...\n")); + if (reread_ioctl(fd) ) { + warnx(_("The command to re-read the partition table failed.\n" "Run partprobe(8), kpartx(8) or reboot your system now,\n" "before using mkfs\n")); - return 0; + return 0; + } } if (close_fd(fd) != 0) { |