Include sysmacros.h where needed

So in glibc-2.23 sys/sysmacros.h is no longer included from sys/types.h
and we don't build because of the usage of major/minor/makedev macros.
Autoconf already has AC_HEADER_MAJOR macro that check where exactly
these functions/macros are defined, so let's use that.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Martin Kletzander 2016-04-14 15:11:45 +02:00
parent 32f3f0835e
commit aca4d72b2a
7 changed files with 43 additions and 0 deletions

View File

@ -144,6 +144,8 @@ AC_TYPE_UID_T
dnl Support building Win32 DLLs (must appear *before* AM_PROG_LIBTOOL)
AC_LIBTOOL_WIN32_DLL
AC_HEADER_MAJOR
m4_ifndef([LT_INIT], [
AM_PROG_LIBTOOL
], [

View File

@ -26,6 +26,12 @@
#include <sys/stat.h>
#include <sys/types.h>
#ifdef MAJOR_IN_MKDEV
# include <sys/mkdev.h>
#elif MAJOR_IN_SYSMACROS
# include <sys/sysmacros.h>
#endif
#include "domain_audit.h"
#include "viraudit.h"
#include "viruuid.h"

View File

@ -28,6 +28,13 @@
#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/types.h>
#ifdef MAJOR_IN_MKDEV
# include <sys/mkdev.h>
#elif MAJOR_IN_SYSMACROS
# include <sys/sysmacros.h>
#endif
#include <sys/un.h>
#include <sys/personality.h>
#include <unistd.h>

View File

@ -29,6 +29,13 @@
#include <sys/utsname.h>
#include <string.h>
#include <sys/types.h>
#ifdef MAJOR_IN_MKDEV
# include <sys/mkdev.h>
#elif MAJOR_IN_SYSMACROS
# include <sys/sysmacros.h>
#endif
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>

View File

@ -35,6 +35,13 @@
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef MAJOR_IN_MKDEV
# include <sys/mkdev.h>
#elif MAJOR_IN_SYSMACROS
# include <sys/sysmacros.h>
#endif
#include <signal.h>
#include <dirent.h>
#include <unistd.h>

View File

@ -36,6 +36,13 @@
#include <poll.h>
#include <sys/stat.h>
#include <sys/types.h>
#ifdef MAJOR_IN_MKDEV
# include <sys/mkdev.h>
#elif MAJOR_IN_SYSMACROS
# include <sys/sysmacros.h>
#endif
#include <sys/ioctl.h>
#include <string.h>
#include <termios.h>

View File

@ -29,6 +29,13 @@
# include <unistd.h>
# include <fcntl.h>
# include <sys/stat.h>
# ifdef MAJOR_IN_MKDEV
# include <sys/mkdev.h>
# elif MAJOR_IN_SYSMACROS
# include <sys/sysmacros.h>
# endif
# include <stdarg.h>
# include "testutilslxc.h"
# include "virstring.h"