From 3bbc4a188f236a8944eaadc20439b6c3cf372a8d Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 31 May 2002 21:38:47 +0000 Subject: [PATCH] * socket-utils.h (socklen) [! HAVE_SA_LEN]: Return a socklen_t instead of size_t git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14463 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/ChangeLog | 3 +++ src/include/socket-utils.h | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index b1f68f78b..2fdec2914 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,5 +1,8 @@ 2002-05-31 Ken Raeburn + * socket-utils.h (socklen) [! HAVE_SA_LEN]: Return a socklen_t + instead of size_t. + * configure.in: Check return type for getservbyname_r just as for gethostbyname_r. * fake-addrinfo.h (GET_HOST_BY_NAME): Use plain gethostbyname if diff --git a/src/include/socket-utils.h b/src/include/socket-utils.h index 82e85f178..b71545950 100644 --- a/src/include/socket-utils.h +++ b/src/include/socket-utils.h @@ -109,15 +109,14 @@ static __inline__ struct sockaddr_in6 *ss2sin6 (struct sockaddr_storage *ss) #endif #if !defined (socklen) -/* size_t socklen (struct sockaddr *) */ -/* Should this return socklen_t instead? */ +/* socklen_t socklen (struct sockaddr *) */ # ifdef HAVE_SA_LEN # define socklen(X) ((X)->sa_len) # else # ifdef KRB5_USE_INET6 -# define socklen(X) ((X)->sa_family == AF_INET6 ? sizeof (struct sockaddr_in6) : (X)->sa_family == AF_INET ? sizeof (struct sockaddr_in) : sizeof (struct sockaddr)) +# define socklen(X) ((X)->sa_family == AF_INET6 ? (socklen_t) sizeof (struct sockaddr_in6) : (X)->sa_family == AF_INET ? (socklen_t) sizeof (struct sockaddr_in) : (socklen_t) sizeof (struct sockaddr)) # else -# define socklen(X) ((X)->sa_family == AF_INET ? sizeof (struct sockaddr_in) : sizeof (struct sockaddr)) +# define socklen(X) ((X)->sa_family == AF_INET ? (socklen_t) sizeof (struct sockaddr_in) : (socklen_t) sizeof (struct sockaddr)) # endif # endif #endif -- 2.26.2