]> git.pond.sub.org Git - empserver/commitdiff
(service_main) [_WIN32]: Added the missing empth_wait_for_signal() and
authorRon Koenderink <rkoenderink@yahoo.ca>
Sat, 10 Jun 2006 04:11:16 +0000 (04:11 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Sat, 10 Jun 2006 04:11:16 +0000 (04:11 +0000)
shutdown() for when the server is running at WIN32 service.  This fix
incorporates the changes that where done to the main thread.

src/lib/gen/service.c

index 8737fc5a1b5e4257f36038f2c4384c93876fb623..8255f274574cbdeebdd519b0f4c695272f6a7c57 100644 (file)
@@ -173,6 +173,8 @@ service_ctrl_handler(DWORD Opcode)
 void WINAPI
 service_main(DWORD argc, LPTSTR *argv)
 {
+    int sig;
+    
     service_status.dwServiceType        = SERVICE_WIN32; 
     service_status.dwCurrentState       = SERVICE_START_PENDING; 
     service_status.dwControlsAccepted   = SERVICE_ACCEPT_STOP; 
@@ -201,7 +203,9 @@ service_main(DWORD argc, LPTSTR *argv)
         logerror("SetServiceStatus error %ld\n", GetLastError());
     }
 
-    empth_exit();
+    sig = empth_wait_for_signal();
+
+    shutdwn(sig);
 
     CANT_REACH();
     finish_server();