# | Line 105 | Line 105 | comm_init( /* set up and execute driver */ | |
---|---|---|
105 | goto syserr; | |
106 | close(p1[0]); | |
107 | close(p2[1]); | |
108 | + | /* |
109 | + | * Close write stream on exec to avoid multiprocessing deadlock. |
110 | + | * No use in read stream without it, so set flag there as well. |
111 | + | */ |
112 | + | fcntl(p1[1], F_SETFD, FD_CLOEXEC); |
113 | + | fcntl(p2[0], F_SETFD, FD_CLOEXEC); |
114 | if ((devout = fdopen(p1[1], "w")) == NULL) | |
115 | goto syserr; | |
116 | if ((devin = fdopen(p2[0], "r")) == NULL) |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |