summaryrefslogtreecommitdiffstats
path: root/fdisk/cfdisk.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/cfdisk.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/cfdisk.c')
-rw-r--r--fdisk/cfdisk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fdisk/cfdisk.c b/fdisk/cfdisk.c
index 9d32a1908..300518d6e 100644
--- a/fdisk/cfdisk.c
+++ b/fdisk/cfdisk.c
@@ -1685,6 +1685,7 @@ fill_p_info(void) {
clear_warning();
}
+#ifdef BLKFLSBUF
/* Blocks are visible in more than one way:
e.g. as block on /dev/hda and as block on /dev/hda3
By a bug in the Linux buffer cache, we will see the old
@@ -1694,6 +1695,7 @@ fill_p_info(void) {
so this only plays a role if we want to show volume labels. */
ioctl(fd, BLKFLSBUF); /* ignore errors */
/* e.g. Permission Denied */
+#endif
if (blkdev_get_sectors(fd, &llsectors) == -1)
fatal(_("Cannot get disk size"), 3);
@@ -1903,10 +1905,12 @@ write_part_table(void) {
}
if (is_bdev) {
+#ifdef BLKRRPART
sync();
sleep(2);
if (!ioctl(fd,BLKRRPART))
changed = TRUE;
+#endif
sync();
sleep(4);