]> granicus.if.org Git - strace/commitdiff
Do not use AC_HEADER_MAJOR, include <sys/sysmacros.h> unconditionally
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 26 Aug 2016 21:32:53 +0000 (21:32 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 29 Aug 2016 15:36:02 +0000 (15:36 +0000)
glibc, starting with commit glibc-2.24-28-gdbab657, has deprecated
inclusion of <sys/sysmacros.h> by <sys/types.h>.  The method used
for deprecation breaks AC_HEADER_MAJOR: this autoconf macro no longer
defines MAJOR_IN_SYSMACROS, which consequently breaks build.

Let's assume that all systems supported by strace provide major, minor,
and makedev macros via <sys/sysmacros.h>.

* configure.ac (AC_HEADER_MAJOR): Remove.
* mknod.c [MAJOR_IN_SYSMACROS, MAJOR_IN_MKDEV]: Remove.
Include <sys/sysmacros.h> unconditionally.
* print_struct_stat.c: Likewise.
* tests/mknod.c: Likewise.
* tests/mknodat.c: Likewise.
* tests/xstatx.c: Likewise.

configure.ac
mknod.c
print_struct_stat.c
tests/mknod.c
tests/mknodat.c
tests/xstatx.c

index 110b63733cfcb961456294643127a77fb4b9ca1f..3b481e1296ceb41fe451ffbb80401c9b58169b5b 100644 (file)
@@ -284,7 +284,6 @@ AC_TYPE_SIGNAL
 AC_TYPE_UID_T
 
 AC_HEADER_DIRENT
-AC_HEADER_MAJOR
 AC_HEADER_STAT
 AC_HEADER_STDBOOL
 AC_HEADER_STDC
diff --git a/mknod.c b/mknod.c
index dbcffd7f0b84bbe61e0f3c6c873b01d41f11a887..9b903116364bfce168fbf756ae3283d95b17bdb9 100644 (file)
--- a/mknod.c
+++ b/mknod.c
 
 #include <fcntl.h>
 #include <sys/stat.h>
-
-#ifdef MAJOR_IN_SYSMACROS
-# include <sys/sysmacros.h>
-#endif
-
-#ifdef MAJOR_IN_MKDEV
-# include <sys/mkdev.h>
-#endif
+#include <sys/sysmacros.h>
 
 static void
 decode_mknod(struct tcb *tcp, int offset)
index fd902dc6e98145cc10431ea27447eec6b5ce0e11..7b23ec8a8bcda7b35134b4366d810f057c868013 100644 (file)
 
 #include "defs.h"
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 #include "stat.h"
-#if defined MAJOR_IN_SYSMACROS
-# include <sys/sysmacros.h>
-#elif defined MAJOR_IN_MKDEV
-# include <sys/mkdev.h>
-#endif
 
 void
 print_struct_stat(struct tcb *tcp, const struct strace_stat *const st)
index 98712e196a4fa213fb6e5aa724d497cd2b10b4ed..2d428743862b37d6ede013d675cc3abc5c0bfa10 100644 (file)
@@ -5,15 +5,9 @@
 
 # include <stdio.h>
 # include <sys/stat.h>
+# include <sys/sysmacros.h>
 # include <unistd.h>
 
-# ifdef MAJOR_IN_SYSMACROS
-#  include <sys/sysmacros.h>
-# endif
-# ifdef MAJOR_IN_MKDEV
-#  include <sys/mkdev.h>
-# endif
-
 static const char sample[] = "mknod";
 
 static long
index a50e813205f4f443741f913827565b8f04715dd2..614513e8bec02d0b6aabb3968a57c5a2b71dc5ce 100644 (file)
@@ -5,15 +5,9 @@
 
 # include <stdio.h>
 # include <sys/stat.h>
+# include <sys/sysmacros.h>
 # include <unistd.h>
 
-# ifdef MAJOR_IN_SYSMACROS
-#  include <sys/sysmacros.h>
-# endif
-# ifdef MAJOR_IN_MKDEV
-#  include <sys/mkdev.h>
-# endif
-
 static const char sample[] = "mknodat_sample";
 static const long int fd = (long int) 0xdeadbeefffffffff;
 
index 48b36873ead3a100e80c4d7a913df3ac51773f2f..359ee1dbdbb53937175c7b7b118634fdcb71ff25 100644 (file)
 # include <stddef.h>
 # include <time.h>
 # include <unistd.h>
-
-# if defined MAJOR_IN_SYSMACROS
-#  include <sys/sysmacros.h>
-# elif defined MAJOR_IN_MKDEV
-#  include <sys/mkdev.h>
-# else
-#  include <sys/types.h>
-# endif
+# include <sys/sysmacros.h>
 
 static void
 print_time(const time_t t)