diff --git a/servers/lloadd/daemon.c b/servers/lloadd/daemon.c index e47ea567c2..841d423e64 100644 --- a/servers/lloadd/daemon.c +++ b/servers/lloadd/daemon.c @@ -1302,9 +1302,11 @@ lloadd_daemon( struct event_base *daemon_base ) assert( daemon_base != NULL ); - dnsbase = evdns_base_new( daemon_base, - EVDNS_BASE_INITIALIZE_NAMESERVERS | - EVDNS_BASE_DISABLE_WHEN_INACTIVE ); +#ifndef EVDNS_BASE_INITIALIZE_NAMESERVERS /* libevent 2.0 support */ +#define EVDNS_BASE_INITIALIZE_NAMESERVERS 1 +#endif /* !EVDNS_BASE_INITIALIZE_NAMESERVERS */ + + dnsbase = evdns_base_new( daemon_base, EVDNS_BASE_INITIALIZE_NAMESERVERS ); if ( !dnsbase ) { Debug( LDAP_DEBUG_ANY, "lloadd startup: " "failed to set up for async name resolution\n" ); @@ -1358,7 +1360,7 @@ lloadd_daemon( struct event_base *daemon_base ) } } - event = evtimer_new( daemon_base, operations_timeout, event_self_cbarg() ); + event = evtimer_new( daemon_base, operations_timeout, NULL ); if ( !event ) { Debug( LDAP_DEBUG_ANY, "lloadd: " "failed to allocate timeout event\n" ); diff --git a/servers/lloadd/libevent_support.c b/servers/lloadd/libevent_support.c index 9ba4974a47..9a70d8110a 100644 --- a/servers/lloadd/libevent_support.c +++ b/servers/lloadd/libevent_support.c @@ -167,5 +167,7 @@ lload_libevent_init( void ) void lload_libevent_destroy( void ) { +#if ( EVENT__NUMERIC_VERSION >= 0x02010000 ) libevent_global_shutdown(); +#endif } diff --git a/servers/lloadd/operation.c b/servers/lloadd/operation.c index 6564ecdfaf..1946dc6653 100644 --- a/servers/lloadd/operation.c +++ b/servers/lloadd/operation.c @@ -983,7 +983,6 @@ backend_timeout( void operations_timeout( evutil_socket_t s, short what, void *arg ) { - struct event *self = arg; LloadBackend *b; time_t threshold; @@ -1009,7 +1008,7 @@ operations_timeout( evutil_socket_t s, short what, void *arg ) done: Debug( LDAP_DEBUG_TRACE, "operations_timeout: " "timeout task finished\n" ); - evtimer_add( self, lload_timeout_api ); + evtimer_add( lload_timeout_event, lload_timeout_api ); } void