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

Comparing ray/src/common/process.c (file contents):
Revision 2.3 by greg, Thu Apr 1 11:08:05 1993 UTC vs.
Revision 2.6 by greg, Tue Feb 25 02:47:21 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1991 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Routines to communicate with separate process via dual pipes
6 + *
7 + * External symbols declared in standard.h
8   */
9  
10 + #include "copyright.h"
11 +
12                                  /* find pipe buffer limit */
13   #include  <sys/param.h>
14  
# Line 25 | Line 26 | static char SCCSid[] = "$SunId$ LBL";
26  
27   #include  "vfork.h"
28  
29 + #ifndef BSD
30 + #include  <errno.h>
31 + #endif
32  
33 +
34   int
35   open_process(pd, av)            /* open communication to separate process */
36   int     pd[3];
# Line 101 | Line 106 | char   *bpos;
106   int     siz;
107   {
108          register int    cc = 0, nrem = siz;
109 <
109 > retry:
110          while (nrem > 0 && (cc = read(fd, bpos, nrem)) > 0) {
111                  bpos += cc;
112                  nrem -= cc;
113          }
114 <        if (cc < 0)
114 >        if (cc < 0) {
115 > #ifndef BSD
116 >                if (errno == EINTR)     /* we were interrupted! */
117 >                        goto retry;
118 > #endif
119                  return(cc);
120 +        }
121          return(siz-nrem);
122   }
123  
# Line 119 | Line 129 | char   *bpos;
129   int     siz;
130   {
131          register int    cc = 0, nrem = siz;
132 <
132 > retry:
133          while (nrem > 0 && (cc = write(fd, bpos, nrem)) > 0) {
134                  bpos += cc;
135                  nrem -= cc;
136          }
137 <        if (cc < 0)
137 >        if (cc < 0) {
138 > #ifndef BSD
139 >                if (errno == EINTR)     /* we were interrupted! */
140 >                        goto retry;
141 > #endif
142                  return(cc);
143 +        }
144          return(siz-nrem);
145   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines