From: William A. Rowe Jr Date: Fri, 15 May 2009 18:03:44 +0000 (+0000) Subject: Pick up earlier SHUTDOWN notification X-Git-Tag: 2.3.3~570 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f069fa97acf3be2491d950973a8fd32375768ba5;p=apache Pick up earlier SHUTDOWN notification git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@775266 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/service.c b/server/mpm/winnt/service.c index 2231b06b49..84c35cc44a 100644 --- a/server/mpm/winnt/service.c +++ b/server/mpm/winnt/service.c @@ -254,9 +254,10 @@ static int ReportStatusToSCMgr(int currentState, int exitCode, int waitHint) if (globdat.hServiceStatus) { if (currentState == SERVICE_RUNNING) { - globdat.ssStatus.dwWaitHint = 0; - globdat.ssStatus.dwCheckPoint = 0; - globdat.ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP; + ctx->ssStatus.dwWaitHint = 0; + ctx->ssStatus.dwCheckPoint = 0; + ctx->ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP + | SERVICE_ACCEPT_SHUTDOWN; } else if (currentState == SERVICE_STOPPED) { globdat.ssStatus.dwWaitHint = 0; @@ -331,7 +332,9 @@ static void set_service_description(void) static VOID WINAPI service_nt_ctrl(DWORD dwCtrlCode) { - if (dwCtrlCode == SERVICE_CONTROL_STOP) + /* SHUTDOWN is offered before STOP, accept the first opportunity */ + if ((dwCtrlCode == SERVICE_CONTROL_STOP) + || (dwCtrlCode == SERVICE_CONTROL_SHUTDOWN)) { ap_signal_parent(SIGNAL_PARENT_SHUTDOWN); ReportStatusToSCMgr(SERVICE_STOP_PENDING, NO_ERROR, 30000);