Skip to content

Commit 0861b4e

Browse files
committed
Fixes in sshd
1 parent 090c14b commit 0861b4e

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

contrib/win32/win32compat/signal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ sw_process_pending_signals() {
184184
BOOL sig_int = FALSE; /* has any signal actually interrupted */
185185

186186
debug3("process_signals()");
187-
int i, exp[] = { W32_SIGCHLD , W32_SIGINT , W32_SIGALRM };
187+
int i, exp[] = { W32_SIGCHLD , W32_SIGINT , W32_SIGALRM, W32_SIGTERM, W32_SIGTSTP };
188188

189189
/* check for expected signals*/
190190
for (i = 0; i < (sizeof(exp) / sizeof(exp[0])); i++)

sshd.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ static void do_ssh2_kex(void);
380380

381381
SetServiceStatus( gSvcStatusHandle, &gSvcStatus );
382382
}
383-
384383
static VOID WINAPI SSHDHandlerEx(DWORD dwControl)
385384
{
386385
debug("Request received (%u)", dwControl);
@@ -397,8 +396,7 @@ static void do_ssh2_kex(void);
397396

398397
ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 500);
399398

400-
raise(SIGINT);
401-
/*TODO - wait for main thread to unwind */
399+
GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, 0);
402400
ReportSvcStatus(SERVICE_STOPPED, NO_ERROR, 0);
403401

404402
return;
@@ -1614,7 +1612,6 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
16141612

16151613
sw_add_child(pi.hProcess, pi.dwProcessId);
16161614
CloseHandle(pi.hThread);
1617-
CloseHandle(pi.hProcess);
16181615
pid = pi.dwProcessId;
16191616
}
16201617

0 commit comments

Comments
 (0)