"daemon: select failed (%d): %s\n",
err, sock_errstr(err), 0 );
#endif
- slapd_shutdown = -1;
+ slapd_shutdown = 2;
}
}
continue;
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"));
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"));
"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" ));
"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,
#endif
else
#endif
- slapd_shutdown = sig;
+ slapd_shutdown = 1;
WAKE_LISTENER(1);