--- ray/src/rt/raypcalls.c 2004/09/17 21:43:50 2.8 +++ ray/src/rt/raypcalls.c 2005/04/19 01:15:06 2.11 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: raypcalls.c,v 2.8 2004/09/17 21:43:50 greg Exp $"; +static const char RCSid[] = "$Id: raypcalls.c,v 2.11 2005/04/19 01:15:06 greg Exp $"; #endif /* * raypcalls.c - interface for parallel rendering using Radiance @@ -43,7 +43,7 @@ static const char RCSid[] = "$Id: raypcalls.c,v 2.8 20 * myRay.rorg = ( ray origin point ) * myRay.rdir = ( normalized ray direction ) * myRay.rmax = ( maximum length, or zero for no limit ) - * rayorigin(&myRay, NULL, PRIMARY, 1.0); + * rayorigin(&myRay, PRIMARY, NULL, NULL); * myRay.rno = ( my personal ray identifier ) * if (ray_pqueue(&myRay) == 1) * { do something with results } @@ -422,7 +422,6 @@ ray_pchild( /* process rays (never returns) */ r_queue[i].parent = NULL; r_queue[i].clipset = NULL; r_queue[i].slights = NULL; - r_queue[i].revf = raytrace; samplendx++; rayclear(&r_queue[i]); rayvalue(&r_queue[i]); @@ -468,6 +467,12 @@ ray_popen( /* open the specified # processes */ if (r_proc[ray_pnprocs].pid < 0) error(SYSTEM, "cannot fork child process"); close(p1[0]); close(p0[1]); + /* + * Close write stream on exec to avoid multiprocessing deadlock. + * No use in read stream without it, so set flag there as well. + */ + fcntl(p1[1], F_SETFD, FD_CLOEXEC); + fcntl(p0[0], F_SETFD, FD_CLOEXEC); r_proc[ray_pnprocs].fd_send = p1[1]; r_proc[ray_pnprocs].fd_recv = p0[0]; r_proc[ray_pnprocs].npending = 0;