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.11 by greg, Fri Mar 4 02:48:14 2016 UTC vs.
Revision 3.13 by greg, Fri Mar 24 12:56:12 2017 UTC

# Line 28 | Line 28 | char   *av[]
28          char    *compath;
29          int     p0[2], p1[2];
30  
31 <        pd->pid = 0;
31 >        pd->pid = -1;
32          pd->running = 0;                /* not going yet */
33          
34          if (av == NULL)                 /* cloning operation? */
# Line 88 | Line 88 | int nproc
88                          close(pd[i].w);
89                          close(pd[i].r);
90                          pd[i].running = 0;
91 <                }
91 >                } else
92 >                        togo -= (pd[i].pid < 0);
93          if (nproc == 1) {                       /* await specific process? */
94                  if (waitpid(pd->pid, &status, 0) != pd->pid)
95                          return(-1);
96 <                pd->pid = 0;
96 >                pd->pid = -1;
97                  return(status>>8 & 0xff);
98          }
99                                                  /* else unordered wait */
100          while (togo > 0 && (pid = wait(&status)) >= 0) {
101                  for (i = nproc; i-- > 0; )
102                          if (pd[i].pid == pid) {
103 <                                pd[i].pid = 0;
103 >                                pd[i].pid = -1;
104                                  --togo;
105                                  break;
106                          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines