]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
blkdev: guard against missing DIOCGDINFO on FreeBSD 11
authorFranco Fichtner <franco@opnsense.org>
Thu, 11 Aug 2016 12:56:08 +0000 (14:56 +0200)
committerFranco Fichtner <franco@opnsense.org>
Thu, 11 Aug 2016 12:58:50 +0000 (14:58 +0200)
DIOCGMEDIASIZE is supported and available since FreeBSD 5, it may
make sense to kill the backwards-glue completely instead.

lib/blkdev.c

index fa42b86befa9206084c515f11cba915046067997..077d92697f55152a8b72100f462ce0c67852791f 100644 (file)
@@ -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;