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.15 by greg, Thu Aug 21 07:05:58 2008 UTC

# Line 54 | Line 54 | final_connect(void)                            /* verify and initialize connec
54          getstate();
55                                                  /* set error vectors */
56          erract[COMMAND].pf = comm_comout;
57 +        /*                                      doesn't work with raypcalls.c
58          if (erract[WARNING].pf != NULL)
59                  erract[WARNING].pf = comm_comout;
60 +        */
61          return(&comm_driver);
62   }
63  
# Line 97 | Line 99 | comm_init(                     /* set up and execute driver */
99                  close(p2[0]);
100                  sprintf(pin, "%d", p1[0]);
101                  sprintf(pout, "%d", p2[1]);
102 <                execl(dvcname, dname, pin, pout, id, 0);
102 >                execl(dvcname, dname, pin, pout, id, NULL);
103                  perror(dvcname);
104                  _exit(127);
105          }
# Line 105 | Line 107 | comm_init(                     /* set up and execute driver */
107                  goto syserr;
108          close(p1[0]);
109          close(p2[1]);
110 +        /*
111 +         * Close write stream on exec to avoid multiprocessing deadlock.
112 +         * No use in read stream without it, so set flag there as well.
113 +         */
114 +        fcntl(p1[1], F_SETFD, FD_CLOEXEC);
115 +        fcntl(p2[0], F_SETFD, FD_CLOEXEC);
116          if ((devout = fdopen(p1[1], "w")) == NULL)
117                  goto syserr;
118          if ((devin = fdopen(p2[0], "r")) == NULL)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines