e2fsprogs-1.43-sysmacros.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. From 30ef41f68703b6a16027cc8787118b87f1462dff Mon Sep 17 00:00:00 2001
  2. From: Mike Frysinger <vapier@gentoo.org>
  3. Date: Mon, 28 Mar 2016 20:31:33 -0400
  4. Subject: [PATCH e2fsprogs] include sys/sysmacros.h as needed
  5. The minor/major/makedev macros are not entirely standard. glibc has had
  6. the definitions in sys/sysmacros.h since the start, and wants to move away
  7. from always defining them implicitly via sys/types.h (as this pollutes the
  8. namespace in violation of POSIX). Other C libraries have already dropped
  9. them. Since the configure script already checks for this header, use that
  10. to pull in the header in files that use these macros.
  11. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  12. ---
  13. debugfs/debugfs.c | 3 +++
  14. lib/blkid/devname.c | 3 +++
  15. lib/blkid/devno.c | 3 +++
  16. lib/ext2fs/finddev.c | 3 +++
  17. lib/ext2fs/ismounted.c | 3 +++
  18. misc/create_inode.c | 4 ++++
  19. misc/mk_hugefiles.c | 3 +++
  20. 7 files changed, 22 insertions(+)
  21. diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
  22. index ba8be40..7d481bc 100644
  23. --- a/debugfs/debugfs.c
  24. +++ b/debugfs/debugfs.c
  25. @@ -26,6 +26,9 @@ extern char *optarg;
  26. #include <errno.h>
  27. #endif
  28. #include <fcntl.h>
  29. +#ifdef HAVE_SYS_SYSMACROS_H
  30. +#include <sys/sysmacros.h>
  31. +#endif
  32. #include "debugfs.h"
  33. #include "uuid/uuid.h"
  34. diff --git a/lib/blkid/devname.c b/lib/blkid/devname.c
  35. index 3e2efa9..671e781 100644
  36. --- a/lib/blkid/devname.c
  37. +++ b/lib/blkid/devname.c
  38. @@ -36,6 +36,9 @@
  39. #if HAVE_SYS_MKDEV_H
  40. #include <sys/mkdev.h>
  41. #endif
  42. +#ifdef HAVE_SYS_SYSMACROS_H
  43. +#include <sys/sysmacros.h>
  44. +#endif
  45. #include <time.h>
  46. #include "blkidP.h"
  47. diff --git a/lib/blkid/devno.c b/lib/blkid/devno.c
  48. index 479d977..61e6fc7 100644
  49. --- a/lib/blkid/devno.c
  50. +++ b/lib/blkid/devno.c
  51. @@ -31,6 +31,9 @@
  52. #if HAVE_SYS_MKDEV_H
  53. #include <sys/mkdev.h>
  54. #endif
  55. +#ifdef HAVE_SYS_SYSMACROS_H
  56. +#include <sys/sysmacros.h>
  57. +#endif
  58. #include "blkidP.h"
  59. diff --git a/lib/ext2fs/finddev.c b/lib/ext2fs/finddev.c
  60. index 311608d..62fa0db 100644
  61. --- a/lib/ext2fs/finddev.c
  62. +++ b/lib/ext2fs/finddev.c
  63. @@ -31,6 +31,9 @@
  64. #if HAVE_SYS_MKDEV_H
  65. #include <sys/mkdev.h>
  66. #endif
  67. +#ifdef HAVE_SYS_SYSMACROS_H
  68. +#include <sys/sysmacros.h>
  69. +#endif
  70. #include "ext2_fs.h"
  71. #include "ext2fs.h"
  72. diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c
  73. index e0f69dd..7404996 100644
  74. --- a/lib/ext2fs/ismounted.c
  75. +++ b/lib/ext2fs/ismounted.c
  76. @@ -49,6 +49,9 @@
  77. #if HAVE_SYS_TYPES_H
  78. #include <sys/types.h>
  79. #endif
  80. +#ifdef HAVE_SYS_SYSMACROS_H
  81. +#include <sys/sysmacros.h>
  82. +#endif
  83. #include "ext2_fs.h"
  84. #include "ext2fs.h"
  85. diff --git a/misc/create_inode.c b/misc/create_inode.c
  86. index 4dbd8e5..98aeb41 100644
  87. --- a/misc/create_inode.c
  88. +++ b/misc/create_inode.c
  89. @@ -22,6 +22,10 @@
  90. #include <attr/xattr.h>
  91. #endif
  92. #include <sys/ioctl.h>
  93. +#ifdef HAVE_SYS_SYSMACROS_H
  94. +#include <sys/sysmacros.h>
  95. +#endif
  96. +
  97. #include <ext2fs/ext2fs.h>
  98. #include <ext2fs/ext2_types.h>
  99. #include <ext2fs/fiemap.h>
  100. diff --git a/misc/mk_hugefiles.c b/misc/mk_hugefiles.c
  101. index 71a15c5..00e95cd 100644
  102. --- a/misc/mk_hugefiles.c
  103. +++ b/misc/mk_hugefiles.c
  104. @@ -35,6 +35,9 @@ extern int optind;
  105. #include <sys/ioctl.h>
  106. #include <sys/types.h>
  107. #include <sys/stat.h>
  108. +#ifdef HAVE_SYS_SYSMACROS_H
  109. +#include <sys/sysmacros.h>
  110. +#endif
  111. #include <libgen.h>
  112. #include <limits.h>
  113. #include <blkid/blkid.h>
  114. --
  115. 2.8.2