315 |
|
|
316 |
|
/* Close child processes */ |
317 |
|
void |
318 |
< |
end_children() |
318 |
> |
end_children(int immed) |
319 |
|
{ |
320 |
|
int status; |
321 |
|
|
322 |
|
while (nchild > 0) { |
323 |
|
nchild--; |
324 |
< |
if ((status = close_process(&kida[nchild].pr)) > 0) { |
324 |
> |
if (immed) /* error mode -- quick exit */ |
325 |
> |
kill(kida[nchild].pr.pid, SIGKILL); |
326 |
> |
if ((status = close_process(&kida[nchild].pr)) > 0 && !immed) { |
327 |
|
sprintf(errmsg, |
328 |
|
"rendering process returned bad status (%d)", |
329 |
|
status); |
464 |
|
next_child_ready() |
465 |
|
{ |
466 |
|
fd_set writeset, errset; |
467 |
< |
int i, n, nqr; |
467 |
> |
int i, n; |
468 |
|
|
469 |
|
for (i = nchild; i--; ) /* see if there's one free first */ |
470 |
|
if (!kida[i].nr) |
539 |
|
lastray += kida[i].nr = ninq; |
540 |
|
ninq = 0; |
541 |
|
} |
542 |
< |
for (i = nchild; i--; ) { /* get results */ |
543 |
< |
close(kida[i].pr.w); |
542 |
> |
memset(orgdir, 0, sizeof(FVECT)*2); /* get results */ |
543 |
> |
for (i = nchild; i--; ) { |
544 |
> |
writebuf(kida[i].pr.w, (char *)orgdir, sizeof(FVECT)*2); |
545 |
|
queue_results(i); |
546 |
|
} |
547 |
|
if (recover) /* and from before? */ |
548 |
|
queue_modifiers(); |
549 |
< |
end_children(); /* free up file descriptors */ |
549 |
> |
end_children(0); /* free up file descriptors */ |
550 |
|
for (i = 0; i < nmods; i++) |
551 |
|
mod_output(out_bq->mca[i]); /* output accumulated record */ |
552 |
|
end_record(); |