X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fprocess.c;h=2243bf9c46c46b569d404f4af2b79e73f4bc69a5;hb=df6f67895723dd0c4226fa0f94257245a81a273f;hp=15120acaf4d50925665d10ced4215c8fc1a8be14;hpb=aec82bb1c94af6d3142cdef0c51f42f38e9be3e0;p=tinc diff --git a/src/process.c b/src/process.c index 15120aca..2243bf9c 100644 --- a/src/process.c +++ b/src/process.c @@ -109,7 +109,7 @@ static bool install_service(void) { return true; } -static io_t stop_io; +io_t stop_io; DWORD WINAPI controlhandler(DWORD request, DWORD type, LPVOID boe, LPVOID bah) { switch(request) { @@ -135,17 +135,9 @@ DWORD WINAPI controlhandler(DWORD request, DWORD type, LPVOID boe, LPVOID bah) { return NO_ERROR; } -static void stop_handler(void *data, int flags) { - event_exit(); -} - VOID WINAPI run_service(DWORD argc, LPTSTR* argv) { extern int main2(int argc, char **argv); - io_add_event(&stop_io, stop_handler, NULL, WSACreateEvent()); - if (stop_io.event == FALSE) - abort(); - status.dwServiceType = SERVICE_WIN32; status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; status.dwWin32ExitCode = 0; @@ -172,9 +164,6 @@ VOID WINAPI run_service(DWORD argc, LPTSTR* argv) { SetServiceStatus(statushandle, &status); } - if (WSACloseEvent(stop_io.event) == FALSE) - abort(); - io_del(&stop_io); return; }