summaryrefslogtreecommitdiff
path: root/netlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'netlib.c')
-rw-r--r--netlib.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/netlib.c b/netlib.c
index e5287a98..10d4df5b 100644
--- a/netlib.c
+++ b/netlib.c
@@ -18,8 +18,12 @@
#endif
#endif /* S_SPLINT_S */
#ifndef S_SPLINT_S
-#include <netdb.h>
-#include <arpa/inet.h>
+ #ifdef HAVE_NETDB_H
+ #include <netdb.h>
+ #endif /* HAVE_NETDB_H */
+ #ifdef HAVE_ARPA_INET_H
+ #include <arpa/inet.h>
+ #endif /* HAVE_ARPA_INET_H */
#endif /* S_SPLINT_S */
#include <errno.h>
#include <stdlib.h>
@@ -88,7 +92,7 @@ socket_t netlib_connectsock(const char *host, const char *service, const char *p
#endif
#ifdef TCP_NODELAY
if (type == SOCK_STREAM)
- setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &one, sizeof one);
+ setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *)&one, sizeof one);
#endif
return s;
/*@ +type +mustfreefresh @*/