From f069fa97acf3be2491d950973a8fd32375768ba5 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 15 May 2009 18:03:44 +0000 Subject: [PATCH] Pick up earlier SHUTDOWN notification git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@775266 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/winnt/service.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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); -- 2.50.1