commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1430780 - /commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c
Date Wed, 09 Jan 2013 10:54:45 GMT
Author: mturk
Date: Wed Jan  9 10:54:45 2013
New Revision: 1430780

URL: http://svn.apache.org/viewvc?rev=1430780&view=rev
Log:
Make sure STOP and SHUTDOWN share the same code

Modified:
    commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c

Modified: commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c?rev=1430780&r1=1430779&r2=1430780&view=diff
==============================================================================
--- commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c (original)
+++ commons/proper/daemon/branches/1.0.x/src/native/windows/apps/prunsrv/prunsrv.c Wed Jan
 9 10:54:45 2013
@@ -1295,12 +1295,14 @@ void WINAPI service_ctrl_handler(DWORD d
     HANDLE stopThread;
 
     switch (dwCtrlCode) {
+        case SERVICE_CONTROL_SHUTDOWN:
+            apxLogWrite(APXLOG_MARK_INFO "Service SHUTDOWN signaled");
         case SERVICE_CONTROL_STOP:
             reportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 3000);
             /* Stop the service asynchronously */
             stopThread = CreateThread(NULL, 0,
                                       serviceStop,
-                                      (LPVOID)SERVICE_CONTROL_STOP,
+                                      (LPVOID)dwCtrlCode,
                                       0, &threadId);
 #if 0
             /* Seems we don't need to wait for the stop thread
@@ -1309,18 +1311,6 @@ void WINAPI service_ctrl_handler(DWORD d
             WaitForSingleObject(stopThread, INFINITE);
 #endif
             CloseHandle(stopThread);
-
-            return;
-        case SERVICE_CONTROL_SHUTDOWN:
-            apxLogWrite(APXLOG_MARK_INFO "Service SHUTDOWN signaled");
-            reportServiceStatus(SERVICE_STOP_PENDING, NO_ERROR, 3000);
-            /* Stop the service asynchronously */
-            stopThread = CreateThread(NULL, 0,
-                                      serviceStop,
-                                      (LPVOID)SERVICE_CONTROL_SHUTDOWN,
-                                      0, &threadId);
-            WaitForSingleObject(stopThread, INFINITE);
-            CloseHandle(stopThread);
             return;
         case SERVICE_CONTROL_INTERROGATE:
             reportServiceStatus(_service_status.dwCurrentState,



Mime
View raw message