]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
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 059ddc39dc7364989da3e9339598342b0562a1bf..453f5b52281543d135c56d61417767c0c6ac927c 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 3e2efa9d5cb20fc776583dbbb2211273fc363c9a..671e781f0d981d85d28872b97bfdacd118662f87 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 aa6eb9077aeab562c62ccc21807f02de825676f3..480030f201b80e7db454861696605eebd5d8b8c5 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 311608de102f969bb0129b6d4293537c7355853a..62fa0dbe71b076c8c141f42766611f3dbb78c98c 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 bcac0f15a56bf6f7607c5f54a4364f203debae12..7d524715565683095ede120cb9b9d47d441f2ab1 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 ae22ff6fe43e1a3134793cf786072c6c80321a4e..8ce3fafaacc32ef33a4653c86649e573cc136275 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 049c6f4135e245bb757458a4d45a684f58a570a9..5882394dfad4f69bec7c0db2e458cf8ef5ed7937 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>