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.3 by greg, Mon Nov 10 16:41:52 2003 UTC vs.
Revision 3.5 by greg, Fri Sep 17 21:43:49 2004 UTC

# Line 33 | Line 33 | char   *av[]
33                  return(0);
34          if (pipe(p0) < 0 || pipe(p1) < 0)
35                  return(-1);
36 <        if ((pd->pid = vfork()) == 0) {         /* if child */
36 >        if ((pd->pid = fork()) == 0) {          /* if child */
37                  close(p0[1]);
38                  close(p1[0]);
39                  if (p0[0] != 0) {       /* connect p0 to stdin */
# Line 67 | Line 67 | SUBPROC *pd
67   {
68          int     pid, status;
69  
70 +        if (!pd->running)
71 +                return(0);
72          close(pd->r);
73          close(pd->w);
74          pd->running = 0;
75 <        while ((pid = wait(&status)) != -1)
76 <                if (pid == pd->pid)
75 <                        return(status>>8 & 0xff);
75 >        if (waitpid(pd->pid, &status, 0) == pd->pid)
76 >                return(status>>8 & 0xff);
77          return(-1);             /* ? unknown status */
78   }
79  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines