Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | From dd1af7541f18399bcdcb129a8b6618c18ebd9d63 Mon Sep 17 00:00:00 2001 |
| 2 | From: Tomasz Torcz <tomek@pipebreaker.pl> |
| 3 | Date: Sat, 17 Mar 2018 12:56:04 +0100 |
| 4 | Subject: [PATCH] include <sys/sysmacros.h> for major() |
| 5 | |
| 6 | Linux glibc ceased to include it in sys/types.h: |
| 7 | https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html |
| 8 | |
| 9 | Upstream-Status: Backport |
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 11 | --- |
| 12 | configure.ac | 2 +- |
| 13 | module/owlib/src/include/ow.h | 6 +++++- |
| 14 | 2 files changed, 6 insertions(+), 2 deletions(-) |
| 15 | |
| 16 | diff --git a/configure.ac b/configure.ac |
| 17 | index 86751bf7..d625d3f0 100644 |
| 18 | --- a/configure.ac |
| 19 | +++ b/configure.ac |
| 20 | @@ -180,7 +180,7 @@ m4_include([src/scripts/m4/acx_pthread.m4]) |
| 21 | # Checks for header files. |
| 22 | AC_HEADER_DIRENT |
| 23 | AC_HEADER_STDC |
| 24 | -AC_CHECK_HEADERS([asm/types.h arpa/inet.h sys/ioctl.h sys/mkdev.h sys/socket.h sys/time.h sys/times.h sys/types.h sys/param.h sys/uio.h feature_tests.h fcntl.h netinet/in.h stdlib.h string.h strings.h sys/file.h syslog.h termios.h unistd.h limits.h stdint.h features.h getopt.h resolv.h semaphore.h]) |
| 25 | +AC_CHECK_HEADERS([asm/types.h arpa/inet.h sys/ioctl.h sys/mkdev.h sys/socket.h sys/sysmacros.h sys/time.h sys/times.h sys/types.h sys/param.h sys/uio.h feature_tests.h fcntl.h netinet/in.h stdlib.h string.h strings.h sys/file.h syslog.h termios.h unistd.h limits.h stdint.h features.h getopt.h resolv.h semaphore.h]) |
| 26 | AC_CHECK_HEADERS([linux/limits.h linux/types.h netdb.h dlfcn.h]) |
| 27 | AC_CHECK_HEADERS(sys/event.h sys/inotify.h) |
| 28 | |
| 29 | diff --git a/module/owlib/src/include/ow.h b/module/owlib/src/include/ow.h |
| 30 | index 9dbec5f3..0a310552 100644 |
| 31 | --- a/module/owlib/src/include/ow.h |
| 32 | +++ b/module/owlib/src/include/ow.h |
| 33 | @@ -188,8 +188,12 @@ |
| 34 | #include <netdb.h> /* for getaddrinfo */ |
| 35 | #endif /* HAVE_NETDB_H */ |
| 36 | |
| 37 | +#ifdef HAVE_SYS_SYSMACROS_H |
| 38 | +#include <sys/sysmacros.h> /* for major() */ |
| 39 | +#endif /* HAVE_SYS_SYSMACROS_H */ |
| 40 | + |
| 41 | #ifdef HAVE_SYS_MKDEV_H |
| 42 | -#include <sys/mkdev.h> /* for major() */ |
| 43 | +#include <sys/mkdev.h> /* for major() on Solaris */ |
| 44 | #endif /* HAVE_SYS_MKDEV_H */ |
| 45 | |
| 46 | #include <stddef.h> // for offsetof() |