* Define socklen_t to int if it does not exist.

This commit is contained in:
Sam Hocevar
2007-01-08 21:03:32 +00:00
committed by sam
parent de16b710db
commit 77e15f7fb6
2 changed files with 10 additions and 2 deletions

View File

@@ -21,6 +21,8 @@ AC_CHECK_TYPES(sighandler_t, [], [],
#include <signal.h>])
AC_CHECK_TYPES(sig_t, [], [],
[#include <signal.h>])
AC_CHECK_TYPES(socklen_t, [], [],
[#include <sys/types.h>])
AC_CHECK_FUNCS(getopt_long,
[AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)],

View File

@@ -45,13 +45,19 @@
#include "load.h"
#include "fd.h"
#ifdef HAVE_SOCKLEN_T
# define SOCKLEN_T socklen_t
#else
# define SOCKLEN_T int
#endif
/* Library functions that we divert */
static int (*open_orig) (const char *file, int oflag, ...);
#ifdef HAVE_OPEN64
static int (*open64_orig) (const char *file, int oflag, ...);
#endif
static int (*accept_orig) (int sockfd, struct sockaddr *addr,
socklen_t *addrlen);
SOCKLEN_T *addrlen);
static int (*socket_orig) (int domain, int type, int protocol);
static ssize_t (*read_orig) (int fd, void *buf, size_t count);
static off_t (*lseek_orig) (int fd, off_t offset, int whence);
@@ -134,7 +140,7 @@ int open64(const char *file, int oflag, ...)
}
#endif
int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen)
int accept(int sockfd, struct sockaddr *addr, SOCKLEN_T *addrlen)
{
int ret;