#include <netdb.h>
#include <string.h>
#include <unistd.h>
+#ifdef HAVE_IFADDRS_H
#include <ifaddrs.h>
+#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 */
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
}
return;
}
+#endif /* HAVE_IFADDRS_H */
/*
* Try to resolve host name for notify/callback request
*
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,
* 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);