[PATCH 2/2] sfdisk: use is_blkdev

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Davidlohr Bueso <dave@xxxxxxx>

Signed-off-by: Davidlohr Bueso <dave@xxxxxxx>
---
 fdisk/sfdisk.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c
index 469e87f..70a5e2a 100644
--- a/fdisk/sfdisk.c
+++ b/fdisk/sfdisk.c
@@ -794,13 +794,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) {
@@ -808,7 +801,7 @@ reread_disk_partition(char *dev, int fd) {
     fflush(stdout);
     sync();
 
-    if (reread_ioctl(fd) && is_blockdev(fd)) {
+    if (reread_ioctl(fd) && is_blkdev(fd)) {
 	do_warn(_("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"));
-- 
1.7.4.1




--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux