X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fstatd%2Frmtcall.c;h=35cbccb54029fabdbb068a366c7d25000bbc4212;hp=a45705b02433aa900e2be558e11fa6f151f4c5bf;hb=3419e37500dfd19cb2c246260dbd2bc0ee4704d4;hpb=f73e7b9f69835d483cee95e6a20b6307b9d16b77 diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c index a45705b..35cbccb 100644 --- a/utils/statd/rmtcall.c +++ b/utils/statd/rmtcall.c @@ -20,7 +20,9 @@ * it won't if it's worth its money). */ -#include "config.h" +#ifdef HAVE_CONFIG_H +#include +#endif #include #include @@ -35,13 +37,19 @@ #include #include #include +#ifdef HAVE_IFADDRS_H #include +#endif /* HAVE_IFADDRS_H */ #include "sm_inter.h" #include "statd.h" #include "notlist.h" #include "log.h" #include "ha-callout.h" +#if SIZEOF_SOCKLEN_T - 0 == 0 +#define socklen_t int +#endif + #define MAXMSGSIZE (2048 / sizeof(unsigned int)) static unsigned long xid = 0; /* RPC XID counter */ @@ -92,6 +100,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 @@ -136,6 +146,7 @@ reset_my_name(notify_list *lp) } return; } +#endif /* HAVE_IFADDRS_H */ /* * Try to resolve host name for notify/callback request * @@ -271,7 +282,7 @@ recv_rply(int sockfd, struct sockaddr_in *sin, u_long *portp) struct rpc_msg mesg; notify_list *lp = NULL; XDR xdr, *xdrs = &xdr; - int alen = sizeof(*sin); + socklen_t alen = sizeof(*sin); /* Receive message */ if ((msglen = recvfrom(sockfd, msgbuf, sizeof(msgbuf), 0, @@ -377,9 +388,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);