From: Howard Chu Date: Thu, 11 Apr 2002 07:28:30 +0000 (+0000) Subject: ITS#1736 slapd_shutdown can be unsigned X-Git-Tag: OPENLDAP_REL_ENG_2_MP~231 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=98e3499b05fb1877d111893824c06478a7dee37a;p=openldap ITS#1736 slapd_shutdown can be unsigned --- diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 64865406e2..5276f7fddd 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -1162,7 +1162,7 @@ slapd_daemon_task( "daemon: select failed (%d): %s\n", err, sock_errstr(err), 0 ); #endif - slapd_shutdown = -1; + slapd_shutdown = 2; } } continue; @@ -1676,7 +1676,7 @@ slapd_daemon_task( ldap_pvt_thread_yield(); } - if( slapd_shutdown > 0 ) { + if( slapd_shutdown == 1 ) { #ifdef NEW_LOGGING LDAP_LOG(( "connection", LDAP_LEVEL_CRIT, "slapd_daemon_task: shutdown requested and initiated.\n")); @@ -1686,10 +1686,8 @@ slapd_daemon_task( 0, 0, 0 ); #endif - } else if ( slapd_shutdown < 0 ) { + } else if ( slapd_shutdown == 2 ) { #ifdef HAVE_NT_SERVICE_MANAGER - if (slapd_shutdown == -1) - { #ifdef NEW_LOGGING LDAP_LOG(( "connection", LDAP_LEVEL_CRIT, "slapd_daemon_task: shutdown initiated by Service Manager.\n")); @@ -1698,10 +1696,7 @@ slapd_daemon_task( "daemon: shutdown initiated by Service Manager.\n", 0, 0, 0); #endif - } - else -#endif - { +#else /* !HAVE_NT_SERVICE_MANAGER */ #ifdef NEW_LOGGING LDAP_LOG(( "connection", LDAP_LEVEL_CRIT, "slapd_daemon_task: abnormal condition, shutdown initiated.\n" )); @@ -1710,7 +1705,7 @@ slapd_daemon_task( "daemon: abnormal condition, shutdown initiated.\n", 0, 0, 0 ); #endif - } +#endif /* !HAVE_NT_SERVICE_MANAGER */ } else { #ifdef NEW_LOGGING LDAP_LOG(( "connection", LDAP_LEVEL_CRIT, @@ -1869,7 +1864,7 @@ slap_sig_shutdown( int sig ) #endif else #endif - slapd_shutdown = sig; + slapd_shutdown = 1; WAKE_LISTENER(1);