Whamcloud - gitweb
include sys/sysmacros.h as needed
authorMike Frysinger <vapier@gentoo.org>
Fri, 19 May 2017 17:25:59 +0000 (13:25 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 19 May 2017 17:25:59 +0000 (13:25 -0400)
The minor/major/makedev macros are not entirely standard.  glibc has had
the definitions in sys/sysmacros.h since the start, and wants to move away
from always defining them implicitly via sys/types.h (as this pollutes the
namespace in violation of POSIX).  Other C libraries have already dropped
them.  Since the configure script already checks for this header, use that
to pull in the header in files that use these macros.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c
lib/blkid/devname.c
lib/blkid/devno.c
lib/ext2fs/finddev.c
lib/ext2fs/ismounted.c
misc/create_inode.c
misc/mk_hugefiles.c

index 059ddc3..453f5b5 100644 (file)
@@ -26,6 +26,9 @@ extern char *optarg;
 #include <errno.h>
 #endif
 #include <fcntl.h>
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
 
 #include "debugfs.h"
 #include "uuid/uuid.h"
index 3e2efa9..671e781 100644 (file)
@@ -36,6 +36,9 @@
 #if HAVE_SYS_MKDEV_H
 #include <sys/mkdev.h>
 #endif
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
 #include <time.h>
 
 #include "blkidP.h"
index aa6eb90..480030f 100644 (file)
@@ -31,6 +31,9 @@
 #if HAVE_SYS_MKDEV_H
 #include <sys/mkdev.h>
 #endif
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
 
 #include "blkidP.h"
 
index 311608d..62fa0db 100644 (file)
@@ -31,6 +31,9 @@
 #if HAVE_SYS_MKDEV_H
 #include <sys/mkdev.h>
 #endif
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
 
 #include "ext2_fs.h"
 #include "ext2fs.h"
index bcac0f1..7d52471 100644 (file)
@@ -49,6 +49,9 @@
 #if HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
 
 #include "ext2_fs.h"
 #include "ext2fs.h"
index ae22ff6..8ce3faf 100644 (file)
 #include <attr/xattr.h>
 #endif
 #include <sys/ioctl.h>
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
+
 #include <ext2fs/ext2fs.h>
 #include <ext2fs/ext2_types.h>
 #include <ext2fs/fiemap.h>
index 049c6f4..5882394 100644 (file)
@@ -35,6 +35,9 @@ extern int optind;
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifdef HAVE_SYS_SYSMACROS_H
+#include <sys/sysmacros.h>
+#endif
 #include <libgen.h>
 #include <limits.h>
 #include <blkid/blkid.h>