util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/2] sfdisk: use is_blkdev
@ 2012-01-04 23:02 Davidlohr Bueso
  2012-01-04 23:02 ` [PATCH 1/2] blkdev: add is_blkdev function Davidlohr Bueso
  2012-01-05 16:31 ` [PATCH 2/2] sfdisk: use is_blkdev Karel Zak
  0 siblings, 2 replies; 10+ messages in thread
From: Davidlohr Bueso @ 2012-01-04 23:02 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

From: Davidlohr Bueso <dave@gnu.org>

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
 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





^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-01-05 16:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-04 23:02 [PATCH 2/2] sfdisk: use is_blkdev Davidlohr Bueso
2012-01-04 23:02 ` [PATCH 1/2] blkdev: add is_blkdev function Davidlohr Bueso
2012-01-04 22:28   ` [PATCH] lscpu: fix compiler warnings Davidlohr Bueso
     [not found]     ` <1324994959-24298-1-git-send-email-gaowanlong@cn.fujitsu.com>
2011-12-20 13:42       ` [PATCH 4/5] fdisk: remove packed definitions Davidlohr Bueso
2011-12-20 13:42         ` [PATCH 3/5] sfdisk: do not depend on arch for packed attribute Davidlohr Bueso
2012-01-05 16:29           ` Karel Zak
2011-12-22  2:33         ` [PATCH 4/5] fdisk: remove packed definitions Guillem Jover
2012-01-05 16:30     ` [PATCH] lscpu: fix compiler warnings Karel Zak
2012-01-05 16:31   ` [PATCH 1/2] blkdev: add is_blkdev function Karel Zak
2012-01-05 16:31 ` [PATCH 2/2] sfdisk: use is_blkdev Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).