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/sources/patch/applied/ssh1-hangup Date: Wed Dec 12 15:04:49 CET 2012 Signed-off-by: yarikos@gmail.com --- /sys/src/cmd/ssh1/ssh1.c Wed Dec 12 15:04:36 2012 +++ /sys/src/cmd/ssh1/ssh1.c Wed Dec 12 15:04:33 2012 @@ -563,7 +563,8 @@ sendwritemsg(c, buf, n); } sendwritemsg(c, "", 0); - atexitdont(atexitkiller); + if(n >= 0) + atexitdont(atexitkiller); exits(nil); }