Whamcloud - gitweb
libblkid: avoid DIOCGDINFO where missing.
authorMatthias Andree <matthias.andree@gmx.de>
Wed, 8 Jun 2016 18:26:38 +0000 (14:26 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 8 Jun 2016 18:26:38 +0000 (14:26 -0400)
FreeBSD 11 will remove the DIOCGINFO ioctl(), so check if it is defined
before referencing it.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/blkid/getsize.c

index 50293b8..8e8eb4c 100644 (file)
@@ -131,7 +131,7 @@ blkid_loff_t blkid_get_dev_size(int fd)
                        return (blkid_loff_t)this_floppy.size << 9;
        }
 #endif
-#ifdef HAVE_SYS_DISKLABEL_H
+#if defined(HAVE_SYS_DISKLABEL_H) && defined(DIOCGDINFO)
        {
                int part = -1;
                struct disklabel lab;
@@ -158,7 +158,7 @@ blkid_loff_t blkid_get_dev_size(int fd)
                                return pp->p_size << 9;
                }
        }
-#endif /* HAVE_SYS_DISKLABEL_H */
+#endif /* defined(HAVE_SYS_DISKLABEL_H) && defined(DIOCGDINFO) */
        {
 #if defined(HAVE_FSTAT64) && !defined(__OSX_AVAILABLE_BUT_DEPRECATED)
                struct stat64   st;