include sys/sysmacros.h as needed 72/221372/1
authorMike Frysinger <vapier@gentoo.org>
Fri, 19 May 2017 17:25:59 +0000 (13:25 -0400)
committerDongkyun Son <dongkyun.s@samsung.com>
Thu, 2 Jan 2020 02:29:31 +0000 (11:29 +0900)
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>
(cherry picked from commit 3fb715b55426875902dfef3056b2cf7335953178)

Change-Id: If05342f36613523bcb93e010c23f3c33a22fe07a

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 165f924..72b5cbb 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 71a15c5..00e95cd 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>