From: Kurt Zeilenga Date: Sat, 30 Sep 2000 05:34:34 +0000 (+0000) Subject: Check for shutdown after successful select() X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1849 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fcc86b2456e2b625805f63037df8bd51828d59d9;p=openldap Check for shutdown after successful select() --- 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",