From fc01d2a96189edc0c08fb1d757f83c63077b0516 Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Tue, 28 Jun 2011 02:19:21 -0400 Subject: [PATCH] Fix compile error on solaris. Include sys/filio.h explicitly as solaris doesn't define BSD_COMP and thus doesn't pull this header via sys/ioctl.h. Needed for FIONREAD. --- configure.ac | 23 +++++++++++++---------- lib/socket.c | 6 ++++++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 97e191f..9689a1f 100644 --- a/configure.ac +++ b/configure.ac @@ -4,16 +4,6 @@ AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([foreign]) AC_CANONICAL_HOST -case $host in - *darwin*) - RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t" - ;; - *) - ;; -esac - -AC_SUBST(RPCGENFLAGS) - # Work around stupid autoconf default cflags. pt 1 SAVE_CFLAGS="x${CFLAGS}" @@ -56,6 +46,19 @@ if test x$ENABLE_EXAMPLES = xyes; then fi AC_SUBST(MAYBE_EXAMPLES) +case $host in + *darwin*) + RPCGENFLAGS=-DU_INT64_PLATTFORM_TYPE="u_int64_t" + ;; + *solaris*) + AC_CHECK_HEADERS([sys/filio.h]) + ;; + *) + ;; +esac + +AC_SUBST(RPCGENFLAGS) + #output AC_CONFIG_FILES([Makefile] [include/Makefile] diff --git a/lib/socket.c b/lib/socket.c index 7a29134..96bc695 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -15,6 +15,9 @@ along with this program; if not, see . */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include #include #include @@ -25,6 +28,9 @@ #include #include #include +#ifdef HAVE_SYS_FILIO_H +#include +#endif #include #include "libnfs.h" #include "libnfs-raw.h" -- 2.34.1