Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/lib/sh/zcatfd.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | - | |||||||
8 | - | |||||||
9 | - | |||||||
10 | - | |||||||
11 | - | |||||||
12 | - | |||||||
13 | extern ssize_t zread (int, char *, size_t); | - | ||||||
14 | extern int zwrite (int, char *, ssize_t); | - | ||||||
15 | - | |||||||
16 | - | |||||||
17 | - | |||||||
18 | int | - | ||||||
19 | zcatfd (fd, ofd, fn) | - | ||||||
20 | int fd, ofd; | - | ||||||
21 | char *fn; | - | ||||||
22 | { | - | ||||||
23 | ssize_t nr; | - | ||||||
24 | int rval; | - | ||||||
25 | char lbuf[128]; | - | ||||||
26 | - | |||||||
27 | rval = 0; | - | ||||||
28 | while (1) | - | ||||||
29 | { | - | ||||||
30 | nr = zread (fd, lbuf, sizeof (lbuf)); | - | ||||||
31 | if (nr == 0
| 3 | ||||||
32 | break; executed 3 times by 1 test: break; Executed by:
| 3 | ||||||
33 | else if (nr < 0
| 0-3 | ||||||
34 | { | - | ||||||
35 | rval = -1; | - | ||||||
36 | break; never executed: break; | 0 | ||||||
37 | } | - | ||||||
38 | else if (zwrite (ofd, lbuf, nr) < 0
| 0-3 | ||||||
39 | { | - | ||||||
40 | rval = -1; | - | ||||||
41 | break; never executed: break; | 0 | ||||||
42 | } | - | ||||||
43 | } executed 3 times by 1 test: end of block Executed by:
| 3 | ||||||
44 | - | |||||||
45 | return executed 3 times by 1 test: rval;return rval; Executed by:
executed 3 times by 1 test: return rval; Executed by:
| 3 | ||||||
46 | } | - | ||||||
Switch to Source code | Preprocessed file |