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

Comparing ray/src/rt/raypcalls.c (file contents):
Revision 2.23 by greg, Sat Dec 12 19:01:00 2009 UTC vs.
Revision 2.24 by greg, Sat Dec 12 23:08:13 2009 UTC

# Line 224 | Line 224 | ray_pflush(void)                       /* send queued rays to idle childre
224                  ray_pnidle--;           /* now she's busy */
225          }
226          if (sfirst != r_send_next)
227 <                error(CONSISTENCY, "code screwup in ray_pflush");
227 >                error(CONSISTENCY, "code screwup in ray_pflush()");
228          r_send_next = 0;
229          return(sfirst);                 /* return total # sent */
230   }
# Line 239 | Line 239 | ray_psend(                     /* add a ray to our send queue */
239                  return;
240                                          /* flush output if necessary */
241          if (sendq_full() && ray_pflush() <= 0)
242 <                error(INTERNAL, "ray_pflush failed in ray_psend");
242 >                error(INTERNAL, "ray_pflush failed in ray_psend()");
243  
244          r_queue[r_send_next++] = *r;
245   }
# Line 329 | Line 329 | getready:                              /* any children waiting for us? */
329                                  poll ? &tpoll : (struct timeval *)NULL)) < 0)
330                          if (errno != EINTR) {
331                                  error(WARNING,
332 <                                        "select call failed in ray_presult");
332 >                                        "select call failed in ray_presult()");
333                                  ray_pclose(0);
334                                  return(-1);
335                          }
# Line 408 | Line 408 | ray_pchild(    /* process rays (never returns) */
408                                          /* get smuggled set length */
409                  n2 = sizeof(RAY)*r_queue[0].crtype - n;
410                  if (n2 < 0)
411 <                        error(INTERNAL, "buffer over-read in ray_pchild");
411 >                        error(INTERNAL, "buffer over-read in ray_pchild()");
412                  if (n2 > 0) {           /* read the rest of the set */
413                          i = readbuf(fd_in, (char *)r_queue + n, n2);
414                          if (i != n2)
# Line 430 | Line 430 | ray_pchild(    /* process rays (never returns) */
430                                          /* write back our results */
431                  i = writebuf(fd_out, (char *)r_queue, sizeof(RAY)*n);
432                  if (i != sizeof(RAY)*n)
433 <                        error(SYSTEM, "write error in ray_pchild");
433 >                        error(SYSTEM, "write error in ray_pchild()");
434          }
435          if (n)
436 <                error(SYSTEM, "read error in ray_pchild");
436 >                error(SYSTEM, "read error in ray_pchild()");
437          ambsync();
438          quit(0);                        /* normal exit */
439   }
# Line 468 | Line 468 | ray_popen(                     /* open the specified # processes */
468                                  close(r_proc[pn].fd_recv);
469                          }
470                          close(p0[0]); close(p1[1]);
471 +                        close(0);       /* don't share stdin */
472                                          /* following call never returns */
473                          ray_pchild(p1[0], p0[1]);
474                  }
# Line 512 | Line 513 | ray_pclose(            /* close one or more child processes */
513          while (nsub--) {
514                  int     status;
515                  ray_pnprocs--;
515                close(r_proc[ray_pnprocs].fd_recv);
516                  close(r_proc[ray_pnprocs].fd_send);
517                  if (waitpid(r_proc[ray_pnprocs].pid, &status, 0) < 0)
518                          status = 127<<8;
519 +                close(r_proc[ray_pnprocs].fd_recv);
520                  if (status) {
521                          sprintf(errmsg,
522                                  "rendering process %d exited with code %d",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines