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.7 by schorsch, Thu Jun 26 00:58:09 2003 UTC vs.
Revision 2.11 by greg, Fri Jan 15 19:01:53 2021 UTC

# Line 4 | Line 4 | static const char      RCSid[] = "$Id$";
4   /*
5   * Routines to communicate with separate process via dual pipes
6   *
7 < * External symbols declared in standard.h
7 > * External symbols declared in rtprocess.h
8   */
9  
10   #include "copyright.h"
# Line 23 | Line 23 | The functions open_process() and close_process() exist
23  
24   int
25   process(                /* process data through pd */
26 < SUBPROC *pd,
27 < char    *recvbuf, char *sendbuf,
28 < int     nbr, int nbs
26 >        SUBPROC *pd,
27 >        char    *recvbuf, char *sendbuf,
28 >        int     nbr, int nbs
29   )
30   {
31 <        if (nbs > PIPE_BUF)
31 >        if (!(pd->flags & PF_RUNNING))
32                  return(-1);
33          if (writebuf(pd->w, sendbuf, nbs) < nbs)
34                  return(-1);
# Line 37 | Line 37 | int    nbr, int nbs
37  
38  
39  
40 < int
40 > ssize_t
41   readbuf(                /* read all of requested buffer */
42 < int     fd,
43 < char    *bpos,
44 < int     siz
42 >        int     fd,
43 >        char    *bpos,
44 >        ssize_t siz
45   )
46   {
47 <        register int    cc = 0, nrem = siz;
47 >        ssize_t cc = 0, nrem = siz;
48   retry:
49          while (nrem > 0 && (cc = read(fd, bpos, nrem)) > 0) {
50                  bpos += cc;
# Line 61 | Line 61 | retry:
61   }
62  
63  
64 < int
64 > ssize_t
65   writebuf(               /* write all of requested buffer */
66   int     fd,
67   char    *bpos,
68 < int     siz
68 > ssize_t siz
69   )
70   {
71 <        register int    cc = 0, nrem = siz;
71 >        ssize_t cc = 0, nrem = siz;
72   retry:
73          while (nrem > 0 && (cc = write(fd, bpos, nrem)) > 0) {
74                  bpos += cc;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines