]> git.sur5r.net Git - openldap/commitdiff
Check for shutdown after successful select()
authorKurt Zeilenga <kurt@openldap.org>
Sat, 30 Sep 2000 05:34:34 +0000 (05:34 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 30 Sep 2000 05:34:34 +0000 (05:34 +0000)
servers/slapd/daemon.c

index fbeec509bed48b4ced80fd2d1ed6cc454d75492c..127d0adbe6d85f453781771547e0400776334244 100644 (file)
@@ -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",