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.8 by greg, Fri Sep 17 21:43:50 2004 UTC vs.
Revision 2.10 by greg, Fri Apr 15 04:44:51 2005 UTC

# Line 422 | Line 422 | ray_pchild(    /* process rays (never returns) */
422                          r_queue[i].parent = NULL;
423                          r_queue[i].clipset = NULL;
424                          r_queue[i].slights = NULL;
425                        r_queue[i].revf = raytrace;
425                          samplendx++;
426                          rayclear(&r_queue[i]);
427                          rayvalue(&r_queue[i]);
# Line 468 | Line 467 | ray_popen(                     /* open the specified # processes */
467                  if (r_proc[ray_pnprocs].pid < 0)
468                          error(SYSTEM, "cannot fork child process");
469                  close(p1[0]); close(p0[1]);
470 +                /*
471 +                 * Close write stream on exec to avoid multiprocessing deadlock.
472 +                 * No use in read stream without it, so set flag there as well.
473 +                 */
474 +                fcntl(p1[1], F_SETFD, FD_CLOEXEC);
475 +                fcntl(p0[0], F_SETFD, FD_CLOEXEC);
476                  r_proc[ray_pnprocs].fd_send = p1[1];
477                  r_proc[ray_pnprocs].fd_recv = p0[0];
478                  r_proc[ray_pnprocs].npending = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines