summaryrefslogtreecommitdiffstats
path: root/lib/blkdev.c
diff options
context:
space:
mode:
authorFranco Fichtner2016-08-11 14:56:08 +0200
committerFranco Fichtner2016-08-11 14:58:50 +0200
commit6978b2c43096e2d4d7938c359d37ff143505aa13 (patch)
tree578f7f5f7b2d640f5611fee2667369cf73fdf622 /lib/blkdev.c
parentlibmount: Preserve empty string value in optstr parsing (diff)
downloadkernel-qcow2-util-linux-6978b2c43096e2d4d7938c359d37ff143505aa13.tar.gz
kernel-qcow2-util-linux-6978b2c43096e2d4d7938c359d37ff143505aa13.tar.xz
kernel-qcow2-util-linux-6978b2c43096e2d4d7938c359d37ff143505aa13.zip
blkdev: guard against missing DIOCGDINFO on FreeBSD 11
DIOCGMEDIASIZE is supported and available since FreeBSD 5, it may make sense to kill the backwards-glue completely instead.
Diffstat (limited to 'lib/blkdev.c')
-rw-r--r--lib/blkdev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/blkdev.c b/lib/blkdev.c
index fa42b86be..077d92697 100644
--- a/lib/blkdev.c
+++ b/lib/blkdev.c
@@ -133,7 +133,7 @@ blkdev_get_size(int fd, unsigned long long *bytes)
}
#endif /* FDGETPRM */
-#ifdef HAVE_SYS_DISKLABEL_H
+#if defined(HAVE_SYS_DISKLABEL_H) && defined(DIOCGDINFO)
{
/*
* This code works for FreeBSD 4.11 i386, except for the full device
@@ -161,7 +161,7 @@ blkdev_get_size(int fd, unsigned long long *bytes)
}
}
}
-#endif /* HAVE_SYS_DISKLABEL_H */
+#endif /* defined(HAVE_SYS_DISKLABEL_H) && defined(DIOCGDINFO) */
{
struct stat st;