src: include <sys/sysmacros.h> for major() and minor()

This resolves the following deprecation warning (and other instances of
the same warning) when compiling with glibc 2.25 or later:

stat_test.c: In function 'cmp_statx':
stat_test.c:251:13: warning: In the GNU C Library, "major" 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 "major", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "major", you should undefine it after including <sys/types.h>.
  devcmp(dev);
             ^

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Eric Biggers
2017-07-28 21:13:41 -07:00
committed by Eryu Guan
parent 14d318429e
commit 85e3bf85c6
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -31,6 +31,7 @@
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#ifdef __SOLARIS__
#include <sys/mkdev.h>
#endif
+1
View File
@@ -19,6 +19,7 @@
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include "statx.h"
static bool failed = false;