#include "ldap_rq.h"
-#ifdef HAVE_SYS_EPOLL_H
+#if defined(HAVE_SYS_EPOLL_H) && defined(HAVE_EPOLL)
#include <sys/epoll.h>
#endif
static int waking;
#define WAKE_LISTENER(w) \
-do { if (w && waking < 5) { tcp_write( wake_sds[1], "0", 1 ); waking++;} } while(0)
+do { if (w && waking < 5) { waking++; tcp_write( wake_sds[1], "0", 1 ); } } while(0)
volatile sig_atomic_t slapd_shutdown = 0, slapd_gentle_shutdown = 0;
volatile sig_atomic_t slapd_abrupt_shutdown = 0;
rc = epoll_ctl(slap_daemon.sd_epfd, EPOLL_CTL_ADD, s, \
&SLAP_SOCK_EP(s)); \
if ( rc == 0 ) slap_daemon.sd_nfds++; \
- else {
- Debug( LDAP_DEBUG_ANY, "daemon: epoll_ctl ADD failed, errno %d, shutting down\n"
- errno, 0, 0 );
+ else { \
+ Debug( LDAP_DEBUG_ANY, "daemon: epoll_ctl ADD failed, errno %d, shutting down\n", \
+ errno, 0, 0 ); \
slapd_shutdown = 2; \
- }
+ } \
} while(0)
#define SLAP_EV_LISTENER(ptr) (((int *)(ptr) >= slap_daemon.sd_index && \
#define SLAP_EVENT_INIT \
AC_MEMCPY( &readfds, &slap_daemon.sd_readers, sizeof(fd_set) ); \
if ( nwriters ) \
- AC_MEMCPY( &writefds, &slap_daemon.sd_writers, sizeof(fd_set) );
+ AC_MEMCPY( &writefds, &slap_daemon.sd_writers, sizeof(fd_set) )
#ifdef FD_SETSIZE
#define CHK_SETSIZE \
int l;
time_t last_idle_check = 0;
struct timeval idle;
+ int ebadf = 0;
#define SLAPD_IDLE_CHECK_LIMIT 4
int at;
ber_socket_t nfds, nrfds, nwfds;
#define SLAPD_EBADF_LIMIT 16
- int ebadf = 0;
time_t now;