97 |
|
close(p2[0]); |
98 |
|
sprintf(pin, "%d", p1[0]); |
99 |
|
sprintf(pout, "%d", p2[1]); |
100 |
< |
execl(dvcname, dname, pin, pout, id, 0); |
100 |
> |
execl(dvcname, dname, pin, pout, id, NULL); |
101 |
|
perror(dvcname); |
102 |
|
_exit(127); |
103 |
|
} |
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) |