improved sshd child monitor code to avoid annoying "broken pipe" msg from Linux clients

take child detection handle out from select mux after a child process is
detected to have exited so that other code exit handlings can run its
course
This commit is contained in:
quamrulmina 2015-10-02 18:35:08 -05:00
parent 1915208a54
commit 989b8a9f01
2 changed files with 9 additions and 0 deletions

View File

@ -1994,6 +1994,13 @@ int WSHELPAddChildToWatch ( HANDLE processtowatch)
return 0;
}
int WSHELPDelChildToWatch ( HANDLE processtowatch)
{
if ( ChildToWatch == processtowatch )
ChildToWatch = NULL ;
return 0;
}
int WSHELPselect(int fds, fd_set* readsfds, fd_set* writesfds,
fd_set* exceptsfds, const struct timeval* timeout)
{

View File

@ -879,6 +879,8 @@ collect_children(void)
session_close_by_pid(s->pid, status);
CloseHandle(process);
int WSHELPDelChildToWatch (HANDLE processtowatch);
WSHELPDelChildToWatch (process); // take the process off from watch list in select mux
}
}
} while (i > 0);