summaryrefslogtreecommitdiffstats
path: root/fdisk/fdisk.c
diff options
context:
space:
mode:
authorSamuel Thibault2008-07-24 00:46:05 +0200
committerKarel Zak2008-07-24 00:52:52 +0200
commit6b0054a2c6dddb43155220cac13848df98d74423 (patch)
tree27208ec3336d4785d6fcb8b068e9657b96556a6b /fdisk/fdisk.c
parentlib: blkdev.c clean up, non-linux support (diff)
downloadkernel-qcow2-util-linux-6b0054a2c6dddb43155220cac13848df98d74423.tar.gz
kernel-qcow2-util-linux-6b0054a2c6dddb43155220cac13848df98d74423.tar.xz
kernel-qcow2-util-linux-6b0054a2c6dddb43155220cac13848df98d74423.zip
fdisk: non-linux support (BLK* and HDIO_*)
BLK* and HDIO_* are not available on all platform. Work around this in a few places. [kzak@redhat.com: split the original patch to small patches] Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisk/fdisk.c')
-rw-r--r--fdisk/fdisk.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index 58b8bbdef..d3fb1ea96 100644
--- a/fdisk/fdisk.c
+++ b/fdisk/fdisk.c
@@ -2261,10 +2261,15 @@ reread_partition_table(int leave) {
i = fstat(fd, &statbuf);
if (i == 0 && S_ISBLK(statbuf.st_mode)) {
- printf(_("Calling ioctl() to re-read partition table.\n"));
sync();
sleep(2);
+#ifdef BLKRRPART
+ printf(_("Calling ioctl() to re-read partition table.\n"));
i = ioctl(fd, BLKRRPART);
+#else
+ errno = ENOSYS;
+ i = 1;
+#endif
}
if (i) {