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) |
32 |
|
return(-1); |
33 |
< |
if (!pd->running) |
33 |
> |
if (!(pd->flags & PF_RUNNING)) |
34 |
|
return(-1); |
35 |
|
if (writebuf(pd->w, sendbuf, nbs) < nbs) |
36 |
|
return(-1); |
41 |
|
|
42 |
|
int |
43 |
|
readbuf( /* read all of requested buffer */ |
44 |
< |
int fd, |
45 |
< |
char *bpos, |
46 |
< |
int siz |
44 |
> |
int fd, |
45 |
> |
char *bpos, |
46 |
> |
int siz |
47 |
|
) |
48 |
|
{ |
49 |
< |
register int cc = 0, nrem = siz; |
49 |
> |
int cc = 0, nrem = siz; |
50 |
|
retry: |
51 |
|
while (nrem > 0 && (cc = read(fd, bpos, nrem)) > 0) { |
52 |
|
bpos += cc; |
70 |
|
int siz |
71 |
|
) |
72 |
|
{ |
73 |
< |
register int cc = 0, nrem = siz; |
73 |
> |
int cc = 0, nrem = siz; |
74 |
|
retry: |
75 |
|
while (nrem > 0 && (cc = write(fd, bpos, nrem)) > 0) { |
76 |
|
bpos += cc; |