]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sfdisk: use is_blkdev
authorDavidlohr Bueso <dave@gnu.org>
Wed, 4 Jan 2012 23:02:11 +0000 (00:02 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 5 Jan 2012 16:23:21 +0000 (17:23 +0100)
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
fdisk/sfdisk.c

index 3727253af29470a59f255571251d79ea14bfd47f..1225ac375b17d5bbe006377f04c37ecd46677d11 100644 (file)
@@ -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;
     }