From 9a52321f7a775b6ccb15fa0cdec791614db3dc94 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 8 Sep 2005 16:42:48 +0000 Subject: Bring some Solaris changes over from ClamSMTP. --- configure.in | 10 +++++++--- src/proxsmtpd.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/configure.in b/configure.in index 5dc2d93..84c6c51 100644 --- a/configure.in +++ b/configure.in @@ -66,12 +66,16 @@ fi ACX_PTHREAD( , [echo "ERROR: Pthread support not found."; exit 1] ) LIBS="$PTHREAD_LIBS $LIBS" -CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +CFLAGS="$CFLAGS $PTHREAD_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" + +# Some checks for Solaris +AC_CHECK_LIB(socket, getsockname) +AC_CHECK_LIB(nsl, getaddrinfo) # Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(limits.h,,) -AC_CHECK_HEADERS([unistd.h stdio.h stddef.h fcntl.h stdlib.h assert.h errno.h stdarg.h err.h string.h], , +AC_CHECK_HEADERS([limits.h err.h paths.h],,) +AC_CHECK_HEADERS([unistd.h stdio.h stddef.h fcntl.h stdlib.h assert.h errno.h stdarg.h string.h netdb.h], , [echo "ERROR: Required C header missing"; exit 1]) # Check for linux type transparent proxy support diff --git a/src/proxsmtpd.c b/src/proxsmtpd.c index fbd5d25..e0d438e 100644 --- a/src/proxsmtpd.c +++ b/src/proxsmtpd.c @@ -39,14 +39,12 @@ #include #include -#include #include #include #include #include #include #include -#include #include #include "usuals.h" @@ -122,6 +120,10 @@ static int wait_process(spctx_t* sp, pid_t pid, int* status); * STARTUP ETC... */ +#ifndef HAVE___ARGV +char** __argv; +#endif + int main(int argc, char* argv[]) { const char* configfile = DEFAULT_CONFIG; @@ -131,6 +133,10 @@ int main(int argc, char* argv[]) int r; char* t; +#ifndef HAVE___ARGV + __argv = argv; +#endif + /* Setup some defaults */ memset(&g_pxstate, 0, sizeof(g_pxstate)); g_pxstate.directory = _PATH_TMP; -- cgit v1.2.3