| 43 |
|
* myRay.rorg = ( ray origin point ) |
| 44 |
|
* myRay.rdir = ( normalized ray direction ) |
| 45 |
|
* myRay.rmax = ( maximum length, or zero for no limit ) |
| 46 |
< |
* rayorigin(&myRay, NULL, PRIMARY, 1.0); |
| 46 |
> |
* rayorigin(&myRay, PRIMARY, NULL, NULL); |
| 47 |
|
* myRay.rno = ( my personal ray identifier ) |
| 48 |
|
* if (ray_pqueue(&myRay) == 1) |
| 49 |
|
* { do something with results } |
| 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]); |
| 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; |
| 505 |
|
ray_pnprocs--; |
| 506 |
|
close(r_proc[ray_pnprocs].fd_recv); |
| 507 |
|
close(r_proc[ray_pnprocs].fd_send); |
| 508 |
< |
while (wait(&status) != r_proc[ray_pnprocs].pid) |
| 509 |
< |
; |
| 508 |
> |
if (waitpid(r_proc[ray_pnprocs].pid, &status, 0) < 0) |
| 509 |
> |
status = 127<<8; |
| 510 |
|
if (status) { |
| 511 |
|
sprintf(errmsg, |
| 512 |
|
"rendering process %d exited with code %d", |