0001-include-sys-sysmacros.h-for-major.patch 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 0d5e4ba51d2b90a64f5d310d715ed367bbcc8996 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. Linux glibc ceased to include it in sys/types.h:
  6. https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html
  7. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  8. ---
  9. Upstream status: commit 0d5e4ba51d2
  10. configure.ac | 2 +-
  11. module/owlib/src/include/ow.h | 6 +++++-
  12. 2 files changed, 6 insertions(+), 2 deletions(-)
  13. diff --git a/configure.ac b/configure.ac
  14. index 86751bf7cff7..d625d3f02b48 100644
  15. --- a/configure.ac
  16. +++ b/configure.ac
  17. @@ -180,7 +180,7 @@ m4_include([src/scripts/m4/acx_pthread.m4])
  18. # Checks for header files.
  19. AC_HEADER_DIRENT
  20. AC_HEADER_STDC
  21. -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])
  22. +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])
  23. AC_CHECK_HEADERS([linux/limits.h linux/types.h netdb.h dlfcn.h])
  24. AC_CHECK_HEADERS(sys/event.h sys/inotify.h)
  25. diff --git a/module/owlib/src/include/ow.h b/module/owlib/src/include/ow.h
  26. index 9dbec5f31cf7..0a31055238b1 100644
  27. --- a/module/owlib/src/include/ow.h
  28. +++ b/module/owlib/src/include/ow.h
  29. @@ -188,8 +188,12 @@
  30. #include <netdb.h> /* for getaddrinfo */
  31. #endif /* HAVE_NETDB_H */
  32. +#ifdef HAVE_SYS_SYSMACROS_H
  33. +#include <sys/sysmacros.h> /* for major() */
  34. +#endif /* HAVE_SYS_SYSMACROS_H */
  35. +
  36. #ifdef HAVE_SYS_MKDEV_H
  37. -#include <sys/mkdev.h> /* for major() */
  38. +#include <sys/mkdev.h> /* for major() on Solaris */
  39. #endif /* HAVE_SYS_MKDEV_H */
  40. #include <stddef.h> // for offsetof()
  41. --
  42. 2.18.0