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.12 by greg, Fri Mar 4 19:16:49 2016 UTC vs.
Revision 3.15 by greg, Sat Dec 28 18:05:14 2019 UTC

# Line 10 | Line 10 | static const char      RCSid[] = "$Id$";
10  
11   #include "copyright.h"
12  
13 #include <sys/types.h>
13   #include <sys/wait.h>
15 #include <fcntl.h>
14   #include <stdlib.h>
15  
16   #include "rtprocess.h"
# Line 37 | Line 35 | char   *av[]
35                  return(0);
36          if (pipe(p0) < 0 || pipe(p1) < 0)
37                  return(-1);
38 <        if ((pd->pid = fork()) == 0) {  /* if child... */
38 > #ifdef BSD
39 >        if (compath != NULL)
40 >                pd->pid = vfork();      /* more efficient with exec() */
41 >        else
42 > #endif
43 >        pd->pid = fork();
44 >        if (pd->pid == 0) {             /* if child... */
45                  close(p0[1]);
46                  close(p1[0]);
47                  if (p0[0] != 0) {       /* connect p0 to stdin */
# Line 88 | Line 92 | int nproc
92                          close(pd[i].w);
93                          close(pd[i].r);
94                          pd[i].running = 0;
95 <                }
95 >                } else
96 >                        togo -= (pd[i].pid < 0);
97          if (nproc == 1) {                       /* await specific process? */
98                  if (waitpid(pd->pid, &status, 0) != pd->pid)
99                          return(-1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines