summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/include/ChangeLog5
-rw-r--r--src/include/configure.in16
-rw-r--r--src/include/fake-addrinfo.h10
-rw-r--r--src/include/port-sockets.h2
4 files changed, 27 insertions, 6 deletions
diff --git a/src/include/ChangeLog b/src/include/ChangeLog
index a972daf050..30e24b142f 100644
--- a/src/include/ChangeLog
+++ b/src/include/ChangeLog
@@ -1,3 +1,8 @@
+2002-07-05 Ken Raeburn <raeburn@mit.edu>
+
+ * port-sockets.h (SOCKET_WRITEV) [!_WIN32]: Use TMP after setting
+ it, to silence compiler warnings.
+
2002-06-26 Ezra Peisach <epeisach@bu.edu>
* configure.in: Modify test for in6addr_any definition in C
diff --git a/src/include/configure.in b/src/include/configure.in
index 9c9199e7e9..7413bb0394 100644
--- a/src/include/configure.in
+++ b/src/include/configure.in
@@ -5,10 +5,12 @@ AC_PROG_INSTALL
AC_PROG_AWK
AC_PROG_LEX
AC_C_CONST
-AC_CHECK_FUNCS(strdup labs setvbuf memmove bcopy inet_ntoa inet_aton gethostbyname_r gethostbyaddr_r getservbyname_r getservbyport_r seteuid setresuid setreuid setegid setresgid setregid)
+AC_CHECK_FUNCS(strdup labs setvbuf memmove bcopy inet_ntoa inet_aton seteuid setresuid setreuid setegid setresgid setregid)
dnl
dnl Check what the return types for gethostbyname_r and getservbyname_r are.
dnl
+AC_CHECK_FUNC(gethostbyname_r,[
+ac_cv_func_gethostbyname_r=yes
if test "$ac_cv_func_gethostbyname_r" = yes; then
AC_MSG_CHECKING([if gethostbyname_r returns an int])
AC_CACHE_VAL(krb5_cv_gethostbyname_r_returns_int,
@@ -34,7 +36,14 @@ if test "$ac_cv_func_gethostbyname_r" = yes; then
AC_DEFINE(GETHOSTBYNAME_R_RETURNS_INT, 1, [Define if gethostbyname_r returns int rather than struct hostent * ])
fi
fi
+if test "$ac_cv_func_gethostbyname_r" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1, [Define if gethostbyname_r exists and its return type is known])
+ AC_CHECK_FUNC(gethostbyaddr_r)
+fi
+])
dnl
+AC_CHECK_FUNC(getservbyname_r,[
+ac_cv_func_getservbyname_r=yes
if test "$ac_cv_func_getservbyname_r" = yes; then
AC_MSG_CHECKING([if getservbyname_r returns an int])
AC_CACHE_VAL(krb5_cv_getservbyname_r_returns_int,
@@ -60,6 +69,11 @@ if test "$ac_cv_func_getservbyname_r" = yes; then
AC_DEFINE(GETSERVBYNAME_R_RETURNS_INT, 1, [Define if getservbyname_r returns int rather than struct servent * ])
fi
fi
+if test "$ac_cv_func_getservbyname_r" = yes; then
+ AC_DEFINE(HAVE_GETSERVBYNAME_R, 1, [Define if getservbyname_r exists and its return type is known])
+ AC_CHECK_FUNC(getservbyport_r)
+fi
+])
dnl
HAVE_YYLINENO
CHECK_DIRENT
diff --git a/src/include/fake-addrinfo.h b/src/include/fake-addrinfo.h
index c5083bcd7f..8d80b5b329 100644
--- a/src/include/fake-addrinfo.h
+++ b/src/include/fake-addrinfo.h
@@ -128,8 +128,8 @@ gai_strerror (int code) /*@*/;
#endif
#ifdef _WIN32
-#define HAVE_GETADDRINFO
-#define HAVE_GETNAMEINFO
+#define HAVE_GETADDRINFO 1
+#define HAVE_GETNAMEINFO 1
#endif
@@ -379,7 +379,7 @@ int getnameinfo (const struct sockaddr *addr, socklen_t len,
#define HAVE_FAKE_GETADDRINFO /* was not originally HAVE_GETADDRINFO */
#define HAVE_GETADDRINFO
#undef HAVE_GETNAMEINFO
-#define HAVE_GETNAMEINFO
+#define HAVE_GETNAMEINFO 1
static
char *gai_strerror (int code);
@@ -417,6 +417,7 @@ char *gai_strerror (int code);
#endif
#ifdef NEED_FAKE_GETADDRINFO
+#include <string.h> /* for strspn */
static inline int translate_h_errno (int h);
@@ -623,7 +624,8 @@ fake_getnameinfo (const struct sockaddr *sa, socklen_t len,
#endif
} else {
int herr;
- GET_HOST_BY_ADDR(&sinp->sin_addr, sizeof (struct in_addr),
+ GET_HOST_BY_ADDR((const char *) &sinp->sin_addr,
+ sizeof (struct in_addr),
sa->sa_family, hp, herr);
if (hp == 0) {
if (herr == NO_ADDRESS && !(flags & NI_NAMEREQD)) /* ??? */
diff --git a/src/include/port-sockets.h b/src/include/port-sockets.h
index 7c3ed1a914..5dc936af9d 100644
--- a/src/include/port-sockets.h
+++ b/src/include/port-sockets.h
@@ -119,7 +119,7 @@ typedef struct iovec sg_buf;
/* Use TMP to avoid compiler warnings and keep things consistent with
Windoze version. */
#define SOCKET_WRITEV(FD, SG, LEN, TMP) \
- ((TMP) = writev((FD), (SG), (LEN)))
+ ((TMP) = writev((FD), (SG), (LEN)), (TMP))
#define SHUTDOWN_READ 0
#define SHUTDOWN_WRITE 1