mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 20:33:31 +01:00
Merge patch from Matt Edman for bug 162 (service never stops)
svn:r4578
This commit is contained in:
parent
545c2c6c87
commit
441e02d4ac
@ -1472,6 +1472,8 @@ nt_service_is_stopped(void)
|
|||||||
service_status.dwCurrentState = SERVICE_STOPPED;
|
service_status.dwCurrentState = SERVICE_STOPPED;
|
||||||
SetServiceStatus(hStatus, &service_status);
|
SetServiceStatus(hStatus, &service_status);
|
||||||
return 1;
|
return 1;
|
||||||
|
} else if (service_status.dwCurrentState == SERVICE_STOPPED) {
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1480,11 +1482,16 @@ nt_service_is_stopped(void)
|
|||||||
void
|
void
|
||||||
nt_service_control(DWORD request)
|
nt_service_control(DWORD request)
|
||||||
{
|
{
|
||||||
|
static struct timeval exit_now;
|
||||||
|
exit_now.tv_sec = 0;
|
||||||
|
exit_now.tv_usec = 0;
|
||||||
|
|
||||||
switch (request) {
|
switch (request) {
|
||||||
case SERVICE_CONTROL_STOP:
|
case SERVICE_CONTROL_STOP:
|
||||||
case SERVICE_CONTROL_SHUTDOWN:
|
case SERVICE_CONTROL_SHUTDOWN:
|
||||||
log(LOG_ERR, "Got stop/shutdown request; shutting down cleanly.");
|
log(LOG_ERR, "Got stop/shutdown request; shutting down cleanly.");
|
||||||
service_status.dwCurrentState = SERVICE_STOP_PENDING;
|
service_status.dwCurrentState = SERVICE_STOP_PENDING;
|
||||||
|
event_loopexit(&exit_now);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SetServiceStatus(hStatus, &service_status);
|
SetServiceStatus(hStatus, &service_status);
|
||||||
|
Loading…
Reference in New Issue
Block a user