#include "ldap_rq.h"
-#undef HAVE_EPOLL
-
#if defined(HAVE_SYS_EPOLL_H) && defined(HAVE_EPOLL)
#include <sys/epoll.h>
#endif
#ifdef LDAP_PF_LOCAL
case AF_LOCAL: {
char *addr = ((struct sockaddr_un *)*sal)->sun_path;
-#if 0 /* don't muck with socket perms */
- if ( chmod( addr, l.sl_perms ) < 0 && crit ) {
- int err = sock_errno();
- Debug( LDAP_DEBUG_ANY, "daemon: fchmod(%ld) failed errno=%d (%s)",
- (long) l.sl_sd, err, sock_errstr(err) );
- tcp_close( l.sl_sd );
- slap_free_listener_addresses(psal);
- return -1;
- }
-#endif
l.sl_name.bv_len = strlen(addr) + sizeof("PATH=") - 1;
l.sl_name.bv_val = ber_memalloc( l.sl_name.bv_len + 1 );
snprintf( l.sl_name.bv_val, l.sl_name.bv_len + 1,
ber_socket_t i;
int ns, nwriters;
int at;
- ber_socket_t nfds, nrfds, nwfds;
+ ber_socket_t nfds;
+#if SLAP_EVENTS_ARE_INDEXED
+ ber_socket_t nrfds, nwfds;
+#endif
#define SLAPD_EBADF_LIMIT 16
time_t now;
if ( !SLAP_EVENT_IS_READ( slap_listeners[l]->sl_sd ))
continue;
- ns--;
-
rc = slapd_handle_listener(slap_listeners[l]);
#ifdef LDAP_CONNECTIONLESS
if ( rc ) continue;
#endif
+ ns--;
+
/* Don't need to look at this in the data loops */
SLAP_EVENT_CLR_READ( slap_listeners[l]->sl_sd );
SLAP_EVENT_CLR_WRITE( slap_listeners[l]->sl_sd );
#endif
) continue;
+ /* Don't log internal wake events */
+ if ( SLAP_EVENT_FD( i ) == wake_sds[0] )
+ continue;
+
r = SLAP_EVENT_IS_READ( i );
w = SLAP_EVENT_IS_WRITE( i );
if ( r || w ) {
if ( rc ) {
fd = SLAP_EVENT_FD( i );
+ /* Ignore wake events, they were handled above */
+ if ( fd == wake_sds[0] )
+ continue;
+
if( SLAP_EVENT_IS_WRITE( i ) ) {
Debug( LDAP_DEBUG_CONNS,
"daemon: write active on %d\n",