From fcc86b2456e2b625805f63037df8bd51828d59d9 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sat, 30 Sep 2000 05:34:34 +0000 Subject: [PATCH] Check for shutdown after successful select() --- servers/slapd/daemon.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index fbeec509be..127d0adbe6 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -797,6 +797,8 @@ slapd_daemon_task( continue; default: /* something happened - deal with it */ + if( slapd_shutdown ) continue; + ebadf = 0; Debug( LDAP_DEBUG_CONNS, "daemon: activity on %d descriptors\n", ns, 0, 0 ); @@ -837,9 +839,9 @@ slapd_daemon_task( if ( !FD_ISSET( slap_listeners[l]->sl_sd, &readfds ) ) continue; - if ( (s = accept( slap_listeners[l]->sl_sd, - (struct sockaddr *) &from, &len )) == AC_SOCKET_INVALID ) - { + s = accept( slap_listeners[l]->sl_sd, + (struct sockaddr *) &from, &len ); + if ( s == AC_SOCKET_INVALID ) { int err = sock_errno(); Debug( LDAP_DEBUG_ANY, "daemon: accept(%ld) failed errno=%d (%s)\n", -- 2.39.5