about summary refs log tree commit diff
path: root/patches/coreutils-gnulib-glibc-2.25.patch
blob: 4a9d83d25e14a4a1880ec647386fd5ebdf157687 (plain) (blame)
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
54
55
56
57
58
59
60
61
62
63
64
65
commit 4da63c5881f60f71999a943612da9112232b9161
Author: Eric Blake <eblake@redhat.com>
Date:   2016-09-14 19:21:42 -0500

    mountlist: include sysmacros.h for glibc
    
    On Fedora rawhide (glibc 2.25), './gnulib-tool --test mountlist'
    reports:
    ../../gllib/mountlist.c: In function 'read_file_system_list':
    ../../gllib/mountlist.c:534:13: warning: '__makedev_from_sys_types' is deprecated:
      In the GNU C Library, `makedev' is defined by <sys/sysmacros.h>.
      For historical compatibility, it is currently defined by
      <sys/types.h> as well, but we plan to remove this soon.
      To use `makedev', include <sys/sysmacros.h> directly.
      If you did not intend to use a system-defined macro `makedev',
      you should #undef it after including <sys/types.h>.
      [-Wdeprecated-declarations]
                 me->me_dev = makedev (devmaj, devmin);
                 ^~
    In file included from /usr/include/features.h:397:0,
                     from /usr/include/sys/types.h:25,
                     from ./sys/types.h:28,
                     from ../../gllib/mountlist.h:23,
                     from ../../gllib/mountlist.c:20:
    /usr/include/sys/sysmacros.h:89:1: note: declared here
     __SYSMACROS_DEFINE_MAKEDEV (__SYSMACROS_FST_IMPL_TEMPL)
     ^
    
    Fix it by including the right headers.  We also need a fix to
    autoconf's AC_HEADER_MAJOR, but that's a separate patch.
    
    * m4/mountlist.m4 (gl_PREREQ_MOUTLIST_EXTRA): Include
    AC_HEADER_MAJOR.
    * lib/mountlist.c (includes): Use correct headers.
    
    Signed-off-by: Eric Blake <eblake@redhat.com>

diff --git a/lib/mountlist.c b/lib/mountlist.c
index bb4e4ee21097..cf4020e2ab75 100644
--- a/lib/mountlist.c
+++ b/lib/mountlist.c
@@ -37,6 +37,12 @@
 # include <sys/param.h>
 #endif
 
+#if MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#elif MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif
+
 #if defined MOUNTED_GETFSSTAT   /* OSF_1 and Darwin1.3.x */
 # if HAVE_SYS_UCRED_H
 #  include <grp.h> /* needed on OSF V4.0 for definition of NGROUPS,
diff --git a/m4/mountlist.m4 b/m4/mountlist.m4
index 2e2ca37fbf0c..b6724fa33b87 100644
--- a/m4/mountlist.m4
+++ b/m4/mountlist.m4
@@ -15,5 +15,6 @@ AC_DEFUN([gl_PREREQ_MOUNTLIST_EXTRA],
 [
   dnl Note gl_LIST_MOUNTED_FILE_SYSTEMS checks for mntent.h, not sys/mntent.h.
   AC_CHECK_HEADERS([sys/mntent.h])
+  AC_HEADER_MAJOR()dnl for use of makedev ()
   gl_FSTYPENAME
 ])