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

Comparing ray/src/common/unix_process.c (file contents):
Revision 3.5 by greg, Fri Sep 17 21:43:49 2004 UTC vs.
Revision 3.6 by greg, Sun Sep 19 08:42:22 2004 UTC

# 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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines