from sources/david Fixes the problem with orphan fromnet() procs accumulating if their respective fromstin() were hung up (read(0) < 0). The SSH servers we have around (OpenSSH of many different versions) do not cause hang up when they see SSH_CMSG_EOF alone. Reference: /n/atom/patch/applied/ssh1-hangup Date: Sat Mar 22 18:00:38 CET 2014 Signed-off-by: quanstro@quanstro.net --- /sys/src/cmd/ssh1/ssh1.c Sat Mar 22 18:00:27 2014 +++ /sys/src/cmd/ssh1/ssh1.c Sat Mar 22 18:00:28 2014 @@ -562,7 +562,8 @@ sendwritemsg(c, buf, n); } sendwritemsg(c, "", 0); - atexitdont(atexitkiller); + if(n >= 0) /* weren't hung up upon? */ + atexitdont(atexitkiller); exits(nil); }