#include "subnet.h"
#include "xalloc.h"
-volatile bool running = false;
-
/* Purge edges and subnets of unreachable nodes. Use carefully. */
static void purge(void)
}
}
-static void dummy(int a, short b, void *c)
-{
-}
-
static void sigterm_handler(int signal, short events, void *data) {
logger(LOG_NOTICE, _("Got %s signal"), strsignal(signal));
- running = false;
event_loopexit(NULL);
}
extern char *pidfilename;
extern char **g_argv;
extern bool use_logfile;
-extern volatile bool running;
sigset_t emptysigset;
return ERROR_CALL_NOT_IMPLEMENTED;
}
- if(running) {
- running = false;
- status.dwWaitHint = 30000;
- status.dwCurrentState = SERVICE_STOP_PENDING;
- SetServiceStatus(statushandle, &status);
- return NO_ERROR;
- } else {
- status.dwWaitHint = 0;
- status.dwCurrentState = SERVICE_STOPPED;
- SetServiceStatus(statushandle, &status);
- exit(1);
- }
-
+ event_loopexit(NULL);
+ status.dwWaitHint = 30000;
+ status.dwCurrentState = SERVICE_STOP_PENDING;
+ SetServiceStatus(statushandle, &status);
+ return NO_ERROR;
}
VOID WINAPI run_service(DWORD argc, LPTSTR* argv)