ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/devcomm.c
(Generate patch)

Comparing ray/src/rt/devcomm.c (file contents):
Revision 2.12 by schorsch, Tue Mar 30 16:13:01 2004 UTC vs.
Revision 2.14 by greg, Thu May 1 15:50:28 2008 UTC

# Line 97 | Line 97 | comm_init(                     /* set up and execute driver */
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          }
# 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)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines