From 5b34ab66d86f73d7b40b7c3435889c3fb54acbcd Mon Sep 17 00:00:00 2001 From: quamrulmina Date: Mon, 16 Nov 2015 18:19:50 -0600 Subject: [PATCH] sshd server to avoid closing child handle if already closed was causing exception in debugger otherwise. --- serverloop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/serverloop.c b/serverloop.c index 1723361..b59fa1e 100644 --- a/serverloop.c +++ b/serverloop.c @@ -885,11 +885,12 @@ collect_children(void) char *inittermseq = "\033[20l\033[?7h\0" ; // no LFtoCRLF no AUTOWRAPON Channel *c=channel_by_id ( s->chanid ); buffer_append(&c->input, inittermseq, strlen(inittermseq)); - channel_output_poll(); + packet_write_poll(); } session_close_by_pid(s->pid, status); - CloseHandle(process); + if (s->pid) + CloseHandle(process); int WSHELPDelChildToWatch (HANDLE processtowatch); WSHELPDelChildToWatch (process); // take the process off from watch list in select mux }