[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Backport fix for bug 162
Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv10351
Modified Files:
Tag: tor-0_1_0-patches
main.c
Log Message:
Backport fix for bug 162
Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.505.2.4
retrieving revision 1.505.2.5
diff -u -d -r1.505.2.4 -r1.505.2.5
--- main.c 18 Jun 2005 19:46:48 -0000 1.505.2.4
+++ main.c 15 Jul 2005 19:31:39 -0000 1.505.2.5
@@ -1357,17 +1357,24 @@
service_status.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus(hStatus, &service_status);
return 1;
+ } else if (service_status.dwCurrentState == SERVICE_STOPPED) {
+ return 1;
}
return 0;
}
void nt_service_control(DWORD request)
{
+ static struct timeval exit_now;
+ exit_now.tv_sec = 0;
+ exit_now.tv_usec = 0;
+
switch (request) {
case SERVICE_CONTROL_STOP:
case SERVICE_CONTROL_SHUTDOWN:
log(LOG_ERR, "Got stop/shutdown request; shutting down cleanly.");
service_status.dwCurrentState = SERVICE_STOP_PENDING;
+ event_loopexit(&exit_now);
return;
}
SetServiceStatus(hStatus, &service_status);