308 |
|
n = ray_pnprocs - ray_pnidle; |
309 |
|
if (n <= 0) /* return if nothing to await */ |
310 |
|
return(0); |
311 |
+ |
if (!poll && ray_pnprocs == 1) /* one process -> skip select() */ |
312 |
+ |
FD_SET(r_proc[0].fd_recv, &readset); |
313 |
+ |
|
314 |
|
getready: /* any children waiting for us? */ |
315 |
|
for (pn = ray_pnprocs; pn--; ) |
316 |
|
if (FD_ISSET(r_proc[pn].fd_recv, &readset) || |
399 |
|
{ |
400 |
|
int n; |
401 |
|
register int i; |
402 |
+ |
/* flag child process for quit() */ |
403 |
+ |
ray_pnprocs = -1; |
404 |
|
/* read each ray request set */ |
405 |
|
while ((n = read(fd_in, (char *)r_queue, sizeof(r_queue))) > 0) { |
406 |
|
int n2; |
524 |
|
quit(ec) /* make sure exit is called */ |
525 |
|
int ec; |
526 |
|
{ |
527 |
+ |
if (ray_pnprocs > 0) /* close children if any */ |
528 |
+ |
ray_pclose(0); |
529 |
|
exit(ec); |
530 |
|
} |