# | Line 468 | Line 468 | ray_popen( /* open the specified # processes */ | |
---|---|---|
468 | if (r_proc[ray_pnprocs].pid < 0) | |
469 | error(SYSTEM, "cannot fork child process"); | |
470 | close(p1[0]); close(p0[1]); | |
471 | + | /* |
472 | + | * Close write stream on exec to avoid multiprocessing deadlock. |
473 | + | * No use in read stream without it, so set flag there as well. |
474 | + | */ |
475 | + | fcntl(p1[1], F_SETFD, FD_CLOEXEC); |
476 | + | fcntl(p0[0], F_SETFD, FD_CLOEXEC); |
477 | r_proc[ray_pnprocs].fd_send = p1[1]; | |
478 | r_proc[ray_pnprocs].fd_recv = p0[0]; | |
479 | r_proc[ray_pnprocs].npending = 0; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |