Use socklen_t type for accept() if available.

This commit is contained in:
Sam Hocevar 2016-01-10 22:54:19 +01:00
parent 30d2573264
commit 568da70b3b
2 changed files with 7 additions and 0 deletions

View File

@ -20,6 +20,9 @@ AC_CHECK_HEADERS([arpa/inet.h errno.h fcntl.h netdb.h netinet/in.h stdlib.h stri
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM
AC_CHECK_TYPES(socklen_t, [], [],
[#include <sys/types.h>
#include <sys/socket.h>])
# Checks for library functions.
AC_FUNC_FORK

View File

@ -1027,7 +1027,11 @@ void handleAccept(int i)
struct in_addr address;
char const *addressText;
int j;
#if HAVE_SOCKLEN_T
socklen_t addrlen;
#else
int addrlen;
#endif
int index = -1;
int o;
SOCKET nfd;