Ping was broken. It always exited with an wrong status. It sometimes waited for a timeout due to a race condition. Both problems are solved by this patch. Notes: Sat Nov 12 08:42:42 EST 2005 rsc I think I fixed these, albeit in a different way. Thanks. Reference: /n/sources/patch/applied/pingbroken Date: Fri Nov 11 13:19:11 CET 2005 Reviewed-by: rsc --- /sys/src/cmd/ip/ping.c Fri Nov 11 13:19:01 2005 +++ /sys/src/cmd/ip/ping.c Fri Nov 11 13:18:59 2005 @@ -81,6 +81,8 @@ USED(a); if(strstr(msg, "alarm")) noted(NCONT); + else if(strstr(msg, "die")) + exits(0); else noted(NDFLT); } @@ -177,7 +179,7 @@ ip = (Icmp*)buf; sum = 0; - while(!done || first != nil){ + while((!done || first != nil) && nmsg > lostmsgs+rcvdmsgs){ alarm((nmsg-lostmsgs-rcvdmsgs)*interval+5000); n = read(fd, buf, sizeof(buf)); alarm(0); @@ -213,7 +215,8 @@ if(lostmsgs) print("%d out of %d messages lost\n", lostmsgs, lostmsgs+rcvdmsgs); - postnote(PNPROC, senderpid, "die"); + else + postnote(PNPROC, senderpid, "die"); } void