summaryrefslogtreecommitdiff
path: root/sys-cluster/slurm/files/slurm-17.02.6-glibc-2.25.patch
blob: dc48f8475c0021f513627b10b23d835e37741c4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
commit 056d9ff26b1d2ccac45da3c26a6918f182f8c559
Author: Justin Lecher <jlec@gentoo.org>
Date:   Sun Jul 9 15:54:20 2017 +0100

    Include sysmacros.h in addition for major() & minor()
    
    Starting from glibc-2.25 [1] the macros major and minor are only available
    from sys/sysmacros.h. This patch uses an autoconf macro to detect the
    location and includes the header accordingly.
    
    1)
    https://sourceware.org/ml/libc-alpha/2017-02/msg00079.html
    
    Signed-off-by: Justin Lecher <jlec@gentoo.org>

diff --git a/configure.ac b/configure.ac
index 44699ae095..66d4350d44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,7 +124,7 @@ AC_CHECK_HEADERS(mcheck.h values.h socket.h sys/socket.h  \
 AC_HEADER_SYS_WAIT
 AC_HEADER_TIME
 AC_HEADER_STDC
-
+AC_HEADER_MAJOR
 
 dnl Checks for structures.
 dnl
diff --git a/src/plugins/task/cgroup/task_cgroup_devices.c b/src/plugins/task/cgroup/task_cgroup_devices.c
index 6a09b3d52a..63c0a11c9e 100644
--- a/src/plugins/task/cgroup/task_cgroup_devices.c
+++ b/src/plugins/task/cgroup/task_cgroup_devices.c
@@ -34,12 +34,20 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
+#include "config.h"
+
 #define _GNU_SOURCE
 #include <glob.h>
 #include <limits.h>
 #include <sched.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#ifdef MAJOR_IN_MKDEV
+#  include <sys/mkdev.h>
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+#  include <sys/sysmacros.h>
+#endif
 
 #include "slurm/slurm.h"
 #include "slurm/slurm_errno.h"