summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2016-04-27 12:57:08 -0400
committerSteve Dickson <steved@redhat.com>2016-04-27 13:24:40 -0400
commit4ac4b4f74dcec30dcb23aab827eed152db08daea (patch)
treedc1afec4f1e083eb6d0908049109d99bc382a15b /support
parent623f537916a67f96decda3ce9ed8d70edf92c0cd (diff)
downloadnfs-utils-4ac4b4f74dcec30dcb23aab827eed152db08daea.tar.gz
nfs-utils-4ac4b4f74dcec30dcb23aab827eed152db08daea.tar.xz
nfs-utils-4ac4b4f74dcec30dcb23aab827eed152db08daea.zip
fix building w/newer C libraries
Linux C libraries are moving away from implicitly including the header sys/sysmacros.h via sys/types.h. We would like to do this for glibc now, but others (musl/etc...) have been doing it already. This means any code using major/minor/makedevs functions will fail to build when they don't include that header. Leverage the AC_HEADER_MAJOR macro that configure is already using to pull in the right header. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support')
-rw-r--r--support/include/xcommon.h6
-rw-r--r--support/nfs/nfsexport.c1
2 files changed, 7 insertions, 0 deletions
diff --git a/support/include/xcommon.h b/support/include/xcommon.h
index d1a4b18..23c9a13 100644
--- a/support/include/xcommon.h
+++ b/support/include/xcommon.h
@@ -17,6 +17,12 @@
#include <stdlib.h>
#include <string.h>
+#ifdef MAJOR_IN_MKDEV
+#include <sys/mkdev.h>
+#elif defined(MAJOR_IN_SYSMACROS)
+#include <sys/sysmacros.h>
+#endif
+
#define streq(s, t) (strcmp ((s), (t)) == 0)
/* Functions in sundries.c that are used in mount.c and umount.c */
diff --git a/support/nfs/nfsexport.c b/support/nfs/nfsexport.c
index afd7c90..4b13265 100644
--- a/support/nfs/nfsexport.c
+++ b/support/nfs/nfsexport.c
@@ -19,6 +19,7 @@
#include "nfslib.h"
#include "misc.h"
+#include "xcommon.h"
/* if /proc/net/rpc/... exists, then
* write to it, as that interface is more stable.