diff options
author | Davidlohr Bueso | 2012-01-05 00:02:11 +0100 |
---|---|---|
committer | Karel Zak | 2012-01-05 17:23:21 +0100 |
commit | 4e4a25c0dde10eebcb7f7618d0ab4ccedeff3273 (patch) | |
tree | 05b7182c34d608c04eb637e0b6da479db8c1b310 | |
parent | blockdev: make functions static (diff) | |
download | kernel-qcow2-util-linux-4e4a25c0dde10eebcb7f7618d0ab4ccedeff3273.tar.gz kernel-qcow2-util-linux-4e4a25c0dde10eebcb7f7618d0ab4ccedeff3273.tar.xz kernel-qcow2-util-linux-4e4a25c0dde10eebcb7f7618d0ab4ccedeff3273.zip |
sfdisk: use is_blkdev
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
-rw-r--r-- | fdisk/sfdisk.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c index 3727253af..1225ac375 100644 --- a/fdisk/sfdisk.c +++ b/fdisk/sfdisk.c @@ -769,13 +769,6 @@ reread_ioctl(int fd) { return 0; } -static int -is_blockdev(int fd) { - struct stat statbuf; - - return (fstat(fd, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)); -} - /* reread after writing */ static int reread_disk_partition(char *dev, int fd) { @@ -783,10 +776,10 @@ reread_disk_partition(char *dev, int fd) { fflush(stdout); sync(); - if (reread_ioctl(fd) && is_blockdev(fd)) { + if (reread_ioctl(fd) && is_blkdev(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")); + "Run partprobe(8), kpartx(8) or reboot your system now,\n" + "before using mkfs\n")); return 0; } |