Do not use AC_HEADER_MAJOR, include <sys/sysmacros.h> unconditionally

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.
This commit is contained in:
Дмитрий Левин 2016-08-26 21:32:53 +00:00
parent e7d3d645ae
commit 50608a4098
6 changed files with 5 additions and 36 deletions

View 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

View File

@ -35,14 +35,7 @@
#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)

View File

@ -34,12 +34,8 @@
#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)

View 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

View 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;

View File

@ -44,14 +44,7 @@
# 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)