From: Niels Provos Date: Sat, 16 Jun 2007 03:23:15 +0000 (+0000) Subject: make it compile on solaris; from Andrei Nigmatulin X-Git-Tag: release-2.0.1-alpha~615 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa5c8068888ffa501c81d191b93ca1b5765b54b7;p=libevent make it compile on solaris; from Andrei Nigmatulin svn:r366 --- diff --git a/configure.in b/configure.in index 16517521..4a3626b8 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl configure.in for libevent dnl Dug Song AC_INIT(event.c) -AM_INIT_AUTOMAKE(libevent,1.3b) +AM_INIT_AUTOMAKE(libevent,1.3c-trunk) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE @@ -36,6 +36,7 @@ AC_ARG_WITH(rtsig, dnl Checks for libraries. AC_CHECK_LIB(socket, socket) +AC_CHECK_LIB(resolv, inet_aton) dnl Checks for header files. AC_HEADER_STDC diff --git a/devpoll.c b/devpoll.c index 63e1dc90..96582ab0 100644 --- a/devpoll.c +++ b/devpoll.c @@ -36,6 +36,7 @@ #include #endif #include +#include #include #include #include @@ -47,6 +48,7 @@ #include #include "event.h" +#include "event-internal.h" #include "evsignal.h" #include "log.h" diff --git a/event_tagging.c b/event_tagging.c index 6b127243..7a82b829 100644 --- a/event_tagging.c +++ b/event_tagging.c @@ -149,7 +149,7 @@ evtag_marshal_timeval(struct evbuffer *evbuf, u_int8_t tag, struct timeval *tv) EVBUFFER_LENGTH(_buf)); } -static int __inline +static int inline decode_int_internal(u_int32_t *pnumber, struct evbuffer *evbuf, int dodrain) { u_int32_t number = 0; diff --git a/evport.c b/evport.c index 677ae832..7d6f2d26 100644 --- a/evport.c +++ b/evport.c @@ -126,6 +126,7 @@ static int evport_add (void *, struct event *); static int evport_del (void *, struct event *); static int evport_recalc (struct event_base *, void *, int); static int evport_dispatch (struct event_base *, void *, struct timeval *); +static void evport_dealloc (struct event_base *, void *); const struct eventop evportops = { "event ports", @@ -133,7 +134,8 @@ const struct eventop evportops = { evport_add, evport_del, evport_recalc, - evport_dispatch + evport_dispatch, + evport_dealloc }; /* @@ -328,7 +330,7 @@ evport_dispatch(struct event_base *base, void *arg, struct timeval *tv) } if ((res = port_getn(epdp->ed_port, pevtlist, EVENTS_PER_GETN, - &nevents, &ts)) == -1) { + (unsigned int *) &nevents, &ts)) == -1) { if (errno == EINTR) { evsignal_process(base); return (0); @@ -496,3 +498,16 @@ evport_del(void *arg, struct event *ev) } +static void +evport_dealloc(struct event_base *base, void *arg) +{ + struct evport_data *evpd = arg; + + evsignal_dealloc(base); + + close(evpd->ed_port); + + if (evpd->ed_fds) + free(evpd->ed_fds); + free(evpd); +} diff --git a/http.c b/http.c index 88c86959..7b654c7f 100644 --- a/http.c +++ b/http.c @@ -1570,7 +1570,7 @@ evhttp_send_error(struct evhttp_request *req, int error, const char *reason) /* Requires that headers and response code are already set up */ -static __inline void +static inline void evhttp_send(struct evhttp_request *req, struct evbuffer *databuf) { struct evhttp_connection *evcon = req->evcon;