Skip to content

Commit 989b8a9

Browse files
committed
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
1 parent 1915208 commit 989b8a9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

contrib/win32/win32compat/socket.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,13 @@ int WSHELPAddChildToWatch ( HANDLE processtowatch)
19941994
return 0;
19951995
}
19961996

1997+
int WSHELPDelChildToWatch ( HANDLE processtowatch)
1998+
{
1999+
if ( ChildToWatch == processtowatch )
2000+
ChildToWatch = NULL ;
2001+
return 0;
2002+
}
2003+
19972004
int WSHELPselect(int fds, fd_set* readsfds, fd_set* writesfds,
19982005
fd_set* exceptsfds, const struct timeval* timeout)
19992006
{

serverloop.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,8 @@ collect_children(void)
879879
session_close_by_pid(s->pid, status);
880880

881881
CloseHandle(process);
882+
int WSHELPDelChildToWatch (HANDLE processtowatch);
883+
WSHELPDelChildToWatch (process); // take the process off from watch list in select mux
882884
}
883885
}
884886
} while (i > 0);

0 commit comments

Comments
 (0)