success on the sun

This commit is contained in:
rsc 2005-01-07 08:02:54 +00:00
parent c345061e8d
commit 005a85f3a2
3 changed files with 24 additions and 1 deletions

View file

@ -82,7 +82,11 @@ _await(int pid4, char *str, int n, int opt)
ulong u, s;
for(;;){
pid = wait4(pid4, &status, opt, &ru);
/* On Linux, pid==-1 means anyone; on SunOS, it's pid==0. */
if(pid4 == -1)
pid = wait3(&status, opt, &ru);
else
pid = wait4(pid4, &status, opt, &ru);
if(pid <= 0)
return -1;
u = ru.ru_utime.tv_sec*1000+((ru.ru_utime.tv_usec+500)/1000);