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

Comparing ray/src/common/unix_process.c (file contents):
Revision 3.16 by greg, Fri Feb 28 05:18:49 2020 UTC vs.
Revision 3.18 by greg, Tue May 16 20:58:07 2023 UTC

# Line 32 | Line 32 | open_process(          /* open communication to separate proce
32          if (pd->pid > 0)
33                  return(-1);             /* need to close, first */
34          
35 <        if ((pd->flags & (PF_FILT_INP|PF_FILT_OUT)) == (PF_FILT_INP|PF_FILT_OUT))
35 >        if ((pd->flags&(PF_FILT_INP|PF_FILT_OUT)) == (PF_FILT_INP|PF_FILT_OUT))
36                  return(-1);             /* circular process not supported */
37  
38          pd->flags &= ~PF_RUNNING;       /* not running for sure */
# Line 58 | Line 58 | open_process(          /* open communication to separate proce
58                  p1[1] = pd->w;
59          } else if (pipe(p1) < 0)
60                  return(-1);
61 #ifdef BSD
62        if (compath != NULL)
63                pd->pid = vfork();      /* more efficient with exec() */
64        else
65 #endif
61          pd->pid = fork();
62          if (pd->pid == 0) {             /* if child... */
63                  close(p0[1]);
# Line 112 | Line 107 | open_process(          /* open communication to separate proce
107           * No use in read stream without it, so set flag there as well.
108           * GW: This bug took me two days to figure out!!
109           */
110 <        if (pd->r >= 0)
110 >        if (pd->r > 0)
111                  fcntl(pd->r, F_SETFD, FD_CLOEXEC);
112 <        if (pd->w >= 0)
112 >        if (pd->w > 1)
113                  fcntl(pd->w, F_SETFD, FD_CLOEXEC);
114          pd->flags |= PF_RUNNING;
115          return(PIPE_BUF);

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)