| # | Line 12 | Line 12 | static const char RCSid[] = "$Id$"; | |
|---|---|---|
| 12 | ||
| 13 | #include <sys/types.h> | |
| 14 | #include <sys/wait.h> | |
| 15 | + | #include <fcntl.h> |
| 16 | ||
| 17 | #include "rtprocess.h" | |
| 18 | ||
| # | Line 54 | Line 55 | char *av[] | |
| 55 | close(p1[1]); | |
| 56 | pd->r = p1[0]; | |
| 57 | pd->w = p0[1]; | |
| 58 | + | /* |
| 59 | + | * Close write stream on exec to avoid multiprocessing deadlock. |
| 60 | + | * No use in read stream without it, so set flag there as well. |
| 61 | + | * GW: This bug took me two days to figure out!! |
| 62 | + | */ |
| 63 | + | fcntl(pd->r, F_SETFD, FD_CLOEXEC); |
| 64 | + | fcntl(pd->w, F_SETFD, FD_CLOEXEC); |
| 65 | pd->running = 1; | |
| 66 | return(PIPE_BUF); | |
| 67 | } | |
| – | Removed lines |
| + | Added lines |
| < | Changed lines (old) |
| > | Changed lines (new) |