ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rc3.c
(Generate patch)

Comparing ray/src/rt/rc3.c (file contents):
Revision 2.10 by greg, Sat Jun 16 17:09:49 2012 UTC vs.
Revision 2.13 by greg, Tue Jun 19 01:27:13 2012 UTC

# Line 315 | Line 315 | in_rchild()
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);
# Line 462 | Line 464 | static int
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)
# Line 537 | Line 539 | feeder_loop()
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();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines