(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.
This commit is contained in:
parent
0c53200e8e
commit
4a5700e572
1 changed files with 5 additions and 1 deletions
|
@ -173,6 +173,8 @@ service_ctrl_handler(DWORD Opcode)
|
||||||
void WINAPI
|
void WINAPI
|
||||||
service_main(DWORD argc, LPTSTR *argv)
|
service_main(DWORD argc, LPTSTR *argv)
|
||||||
{
|
{
|
||||||
|
int sig;
|
||||||
|
|
||||||
service_status.dwServiceType = SERVICE_WIN32;
|
service_status.dwServiceType = SERVICE_WIN32;
|
||||||
service_status.dwCurrentState = SERVICE_START_PENDING;
|
service_status.dwCurrentState = SERVICE_START_PENDING;
|
||||||
service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP;
|
service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP;
|
||||||
|
@ -201,7 +203,9 @@ service_main(DWORD argc, LPTSTR *argv)
|
||||||
logerror("SetServiceStatus error %ld\n", GetLastError());
|
logerror("SetServiceStatus error %ld\n", GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
empth_exit();
|
sig = empth_wait_for_signal();
|
||||||
|
|
||||||
|
shutdwn(sig);
|
||||||
|
|
||||||
CANT_REACH();
|
CANT_REACH();
|
||||||
finish_server();
|
finish_server();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue