]> granicus.if.org Git - file/commitdiff
Although we are doing the right autoconf magic, MAJOR_IN_SYSMACROS is not
authorChristos Zoulas <christos@zoulas.com>
Tue, 23 Apr 2019 18:59:27 +0000 (18:59 +0000)
committerChristos Zoulas <christos@zoulas.com>
Tue, 23 Apr 2019 18:59:27 +0000 (18:59 +0000)
defined, so we include it anyways if it exists in order to avoid warnings.

configure.ac
src/fsmagic.c

index 1eba8472da14d5175434cb897fecf8874343849f..993bee20ffe53ff8987252072706567f23f6a71f 100644 (file)
@@ -93,7 +93,7 @@ AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(stdint.h fcntl.h inttypes.h unistd.h)
 AC_CHECK_HEADERS(utime.h wchar.h wctype.h)
 AC_CHECK_HEADERS(getopt.h err.h xlocale.h)
-AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
+AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h sys/sysmacros.h)
 if test "$enable_zlib" != "no"; then
   AC_CHECK_HEADERS(zlib.h)
 fi
index 3d7425570b32c135316864bd4a1d9952cfcf4da4..25c4f811567f47273707bf1d556b624c2931b2cc 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: fsmagic.c,v 1.79 2018/10/02 00:38:33 christos Exp $")
+FILE_RCSID("@(#)$File: fsmagic.c,v 1.80 2019/04/23 18:59:27 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -46,11 +46,14 @@ FILE_RCSID("@(#)$File: fsmagic.c,v 1.79 2018/10/02 00:38:33 christos Exp $")
 # include <sys/mkdev.h>
 # define HAVE_MAJOR
 #endif
-#ifdef MAJOR_IN_SYSMACROS
+#ifdef HAVE_SYS_SYSMACROS_H
 # include <sys/sysmacros.h>
+#endif
+#ifdef MAJOR_IN_SYSMACROS
 # define HAVE_MAJOR
 #endif
-#ifdef major                   /* Might be defined in sys/types.h.  */
+#if defined(major) && !defined(HAVE_MAJOR)
+/* Might be defined in sys/types.h.  */
 # define HAVE_MAJOR
 #endif
 #ifdef WIN32