]> 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)
committerKarel Zak <kzak@redhat.com>
Wed, 31 Aug 2016 09:09:36 +0000 (11:09 +0200)
DIOCGMEDIASIZE is supported and available since FreeBSD 5, it may
make sense to kill the backwards-glue completely instead.

lib/blkdev.c

index 8a5a52dfa2d5243cd0217e0a0a6d4bfd0a6cfafd..9b14977a439fee56dcd956551e76a9ec320dcc44 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;