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.1 by greg, Tue Nov 12 16:56:02 1991 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 23 | Line 24 | static char SCCSid[] = "$SunId$ LBL";
24   #endif
25   #endif
26  
27 + #include  "vfork.h"
28 +
29   #ifndef BSD
30 < #define vfork           fork
30 > #include  <errno.h>
31   #endif
32  
33  
# Line 102 | Line 105 | int    fd;
105   char    *bpos;
106   int     siz;
107   {
108 <        register int    cc, nrem = siz;
109 <
108 >        register int    cc = 0, nrem = siz;
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 120 | Line 128 | int    fd;
128   char    *bpos;
129   int     siz;
130   {
131 <        register int    cc, nrem = siz;
132 <
131 >        register int    cc = 0, nrem = siz;
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