diff --git a/contrib/win32/win32compat/signal.c b/contrib/win32/win32compat/signal.c index 8626d69..ed94a18 100644 --- a/contrib/win32/win32compat/signal.c +++ b/contrib/win32/win32compat/signal.c @@ -184,7 +184,7 @@ sw_process_pending_signals() { BOOL sig_int = FALSE; /* has any signal actually interrupted */ debug3("process_signals()"); - int i, exp[] = { W32_SIGCHLD , W32_SIGINT , W32_SIGALRM }; + int i, exp[] = { W32_SIGCHLD , W32_SIGINT , W32_SIGALRM, W32_SIGTERM, W32_SIGTSTP }; /* check for expected signals*/ for (i = 0; i < (sizeof(exp) / sizeof(exp[0])); i++) diff --git a/sshd.c b/sshd.c index 6574088..d138f5c 100644 --- a/sshd.c +++ b/sshd.c @@ -380,7 +380,6 @@ static void do_ssh2_kex(void); SetServiceStatus( gSvcStatusHandle, &gSvcStatus ); } - static VOID WINAPI SSHDHandlerEx(DWORD dwControl) { debug("Request received (%u)", dwControl); @@ -397,8 +396,7 @@ static void do_ssh2_kex(void); ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 500); - raise(SIGINT); - /*TODO - wait for main thread to unwind */ + GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, 0); ReportSvcStatus(SERVICE_STOPPED, NO_ERROR, 0); return; @@ -1614,7 +1612,6 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s) sw_add_child(pi.hProcess, pi.dwProcessId); CloseHandle(pi.hThread); - CloseHandle(pi.hProcess); pid = pi.dwProcessId; }