From: Howard Chu Date: Tue, 2 Jan 2007 10:10:16 +0000 (+0000) Subject: FWIW, SIGBREAK on Windows should only be ignored when running as a Service. X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~279 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1f79382c4f8559c5ca5bbbc9eca688cc1b227767;p=openldap FWIW, SIGBREAK on Windows should only be ignored when running as a Service. --- diff --git a/servers/slurpd/fm.c b/servers/slurpd/fm.c index 9871638736..820b527fa7 100644 --- a/servers/slurpd/fm.c +++ b/servers/slurpd/fm.c @@ -43,6 +43,7 @@ #include "slurp.h" #include "globals.h" +#include "lutil.h" /* @@ -77,8 +78,8 @@ fm( #ifdef SIGHUP (void) SIGNAL( SIGHUP, slurp_set_shutdown ); #endif -#if defined(SIGBREAK) && defined(HAVE_NT_SERVICE_MANAGER) - (void) SIGNAL( SIGBREAK, do_nothing ); +#if defined(SIGBREAK) + (void) SIGNAL( SIGBREAK, slurp_set_shutdown ); #endif if ( sglob->one_shot_mode ) { @@ -165,8 +166,15 @@ fm( RETSIGTYPE slurp_set_shutdown(int sig) { +#if HAVE_NT_SERVICE_MANAGER && SIGBREAK + if (is_NT_Service && sig == SIGBREAK) { + /* empty */; + } else +#endif + { sglob->slurpd_shutdown = 1; /* set flag */ tcp_write( sglob->wake_sds[1], "0", 1); /* wake up file mgr */ + } (void) SIGNAL_REINSTALL( sig, slurp_set_shutdown ); /* reinstall handlers */ }