From c481a5416e5b937541205da23cde15cdabf106c1 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Mon, 17 Apr 2006 16:54:54 +1000 Subject: [PATCH] Define and use HIAVE_IFADDRS_H --- ChangeLog | 7 +++++++ configure.in | 3 ++- utils/statd/rmtcall.c | 8 +++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e2dae51..2ff82a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-04-12 NeilBrown + utils/statd/rmtcall.c: use HAVE_IFADDRS_H to control compilation + of code using ifaddrs.h + configure.in: test for present of ifaddrs.h + + Old glibc's don't have ifaddrs.h + 2006-04-12 NeilBrown Set version to 1.0.8, aclocal -I aclocal ; autoheader ; automake ; autoconf diff --git a/configure.in b/configure.in index 8b538a3..7733077 100644 --- a/configure.in +++ b/configure.in @@ -192,7 +192,8 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h libintl.h limits.h \ malloc.h memory.h netdb.h netinet/in.h paths.h \ stdlib.h string.h sys/file.h sys/ioctl.h sys/mount.h \ sys/param.h sys/socket.h sys/time.h sys/vfs.h \ - syslog.h unistd.h com_err.h et/com_err.h]) + syslog.h unistd.h com_err.h et/com_err.h \ + ifaddrs.h]) dnl ************************************************************* dnl Checks for typedefs, structures, and compiler characteristics diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c index 809d1ad..7684b3b 100644 --- a/utils/statd/rmtcall.c +++ b/utils/statd/rmtcall.c @@ -37,7 +37,9 @@ #include #include #include +#ifdef HAVE_IFADDRS_H #include +#endif /* HAVE_IFADDRS_H */ #include "sm_inter.h" #include "statd.h" #include "notlist.h" @@ -94,6 +96,8 @@ statd_get_socket(int port) out_success: return sockfd; } + +#ifdef HAVE_IFADDRS_H /* * Using the NL_ADDR(lp), reset (if needed) the hostname * that will be put in the SM_NOTIFY to the hostname @@ -138,6 +142,7 @@ reset_my_name(notify_list *lp) } return; } +#endif /* HAVE_IFADDRS_H */ /* * Try to resolve host name for notify/callback request * @@ -379,9 +384,10 @@ process_entry(int sockfd, notify_list *lp) * set the NL_MY_NAME(lp) hostname to the * one associated with the network interface */ +#ifdef HAVE_IFADDRS_H if (!(run_mode & STATIC_HOSTNAME)) reset_my_name(lp); - +#endif /* HAVE_IFADDRS_H */ func = (xdrproc_t) xdr_stat_chge; new_stat.state = MY_STATE; new_stat.mon_name = NL_MY_NAME(lp); -- 2.39.5