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 1.1 by greg, Tue Jul 23 15:56:57 1991 UTC vs.
Revision 2.4 by greg, Fri Apr 16 10:26:45 1993 UTC

# Line 23 | Line 23 | static char SCCSid[] = "$SunId$ LBL";
23   #endif
24   #endif
25  
26 + #include  "vfork.h"
27 +
28   #ifndef BSD
29 < #define vfork           fork
29 > #include  <errno.h>
30   #endif
31  
32  
# Line 102 | Line 104 | int    fd;
104   char    *bpos;
105   int     siz;
106   {
107 <        register int    cc, nrem = siz;
108 <
107 >        register int    cc = 0, nrem = siz;
108 > retry:
109          while (nrem > 0 && (cc = read(fd, bpos, nrem)) > 0) {
110                  bpos += cc;
111                  nrem -= cc;
112          }
113 <        if (cc < 0)
113 >        if (cc < 0) {
114 > #ifndef BSD
115 >                if (errno == EINTR)     /* we were interrupted! */
116 >                        goto retry;
117 > #endif
118                  return(cc);
119 +        }
120          return(siz-nrem);
121   }
122  
# Line 120 | Line 127 | int    fd;
127   char    *bpos;
128   int     siz;
129   {
130 <        register int    cc, nrem = siz;
131 <
130 >        register int    cc = 0, nrem = siz;
131 > retry:
132          while (nrem > 0 && (cc = write(fd, bpos, nrem)) > 0) {
133                  bpos += cc;
134                  nrem -= cc;
135          }
136 <        if (cc < 0)
136 >        if (cc < 0) {
137 > #ifndef BSD
138 >                if (errno == EINTR)     /* we were interrupted! */
139 >                        goto retry;
140 > #endif
141                  return(cc);
142 +        }
143          return(siz-nrem);
144   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines