diff --git a/daemon/main.cpp b/daemon/main.cpp index adfb46fc4..e3e393581 100644 --- a/daemon/main.cpp +++ b/daemon/main.cpp @@ -45,6 +45,14 @@ startWinsock() } return 0; } + +extern "C" BOOL FAR PASCAL +handle_signal_win32(DWORD fdwCtrlType) +{ + UNREFERENCED_PARAMETER(fdwCtrlType); + handle_signal(SIGINT); + return TRUE; // probably unreachable +} #endif int @@ -60,6 +68,7 @@ main(int argc, char *argv[]) #ifdef _WIN32 if(startWinsock()) return -1; + SetConsoleCtrlHandler(handle_signal_win32, TRUE); #endif int opt = 0; diff --git a/llarp/ev_win32.hpp b/llarp/ev_win32.hpp index 78f31cba1..e4b7095e6 100644 --- a/llarp/ev_win32.hpp +++ b/llarp/ev_win32.hpp @@ -764,9 +764,7 @@ struct llarp_win32_loop : public llarp_ev_loop void stop() { - if(upollfd) - upoll_destroy(upollfd); - upollfd = nullptr; + // do nothing } };