From 4a5700e572e98311a1f3fe30d1352795b5b99f2d Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Sat, 10 Jun 2006 04:11:16 +0000 Subject: [PATCH] (service_main) [_WIN32]: Added the missing empth_wait_for_signal() and 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/gen/service.c b/src/lib/gen/service.c index 8737fc5a..8255f274 100644 --- a/src/lib/gen/service.c +++ b/src/lib/gen/service.c @@ -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();