plan9port

[fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port # fast
git clone https://src.adamsgaard.dk/plan9port.git # slow
Log | Files | Refs | README | LICENSE Back to index

commit e45084490f79169a95eda5c6b8efa8814c5f7f79
parent 005a85f3a2ef85ec1a64ce05a486c84e25cf6f94
Author: rsc <devnull@localhost>
Date:   Fri,  7 Jan 2005 17:06:01 +0000

ignore spurious sigchilds on sunos

Diffstat:
Msrc/cmd/9term/9term.c | 13++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/cmd/9term/9term.c b/src/cmd/9term/9term.c @@ -314,8 +314,16 @@ hangupnote(void *a, char *msg) noted(NDFLT); } if(strstr(msg, "child")){ - /* bug: do better */ - threadexitsall(0); + char buf[128]; + int n; + + n = awaitnohang(buf, sizeof buf-1); + if(n > 0){ + buf[n] = 0; + if(atoi(buf) == rcpid) + threadexitsall(0); + } + noted(NCONT); } noted(NDFLT); } @@ -1520,7 +1528,6 @@ backnl(uint p, uint n) return p; p--; } - return 0; /* alef bug */ } void