OpenCoverage

safe-read.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/safe-read.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16-
17-
18size_t-
19safe_read (int fd, void *buf, size_t count)-
20{-
21-
22-
23-
24-
25 enum { BUGGY_READ_MAXIMUM = 0x7fffffff & ~8191 };-
26-
27 for (;;)-
28 {-
29 ssize_t result = read (fd, buf, count);-
30-
31 if (0 <= result
0 <= resultDescription
TRUEevaluated 110726 times by 14 tests
Evaluated by:
  • cat
  • cp
  • csplit
  • factor
  • ginstall
  • head
  • mv
  • split
  • sum
  • tac
  • tail
  • tr
  • wc
  • yes
FALSEevaluated 168 times by 5 tests
Evaluated by:
  • cat
  • split
  • tac
  • tail
  • yes
)
168-110726
32 return
executed 110726 times by 14 tests: return result;
Executed by:
  • cat
  • cp
  • csplit
  • factor
  • ginstall
  • head
  • mv
  • split
  • sum
  • tac
  • tail
  • tr
  • wc
  • yes
result;
executed 110726 times by 14 tests: return result;
Executed by:
  • cat
  • cp
  • csplit
  • factor
  • ginstall
  • head
  • mv
  • split
  • sum
  • tac
  • tail
  • tr
  • wc
  • yes
110726
33 else if (((
(( (*__errno_l...n ()) ) == 4 )Description
TRUEnever evaluated
FALSEevaluated 168 times by 5 tests
Evaluated by:
  • cat
  • split
  • tac
  • tail
  • yes
0-168
34 (*__errno_location ())
(( (*__errno_l...n ()) ) == 4 )Description
TRUEnever evaluated
FALSEevaluated 168 times by 5 tests
Evaluated by:
  • cat
  • split
  • tac
  • tail
  • yes
0-168
35 ) ==
(( (*__errno_l...n ()) ) == 4 )Description
TRUEnever evaluated
FALSEevaluated 168 times by 5 tests
Evaluated by:
  • cat
  • split
  • tac
  • tail
  • yes
0-168
36 4
(( (*__errno_l...n ()) ) == 4 )Description
TRUEnever evaluated
FALSEevaluated 168 times by 5 tests
Evaluated by:
  • cat
  • split
  • tac
  • tail
  • yes
0-168
37 )
(( (*__errno_l...n ()) ) == 4 )Description
TRUEnever evaluated
FALSEevaluated 168 times by 5 tests
Evaluated by:
  • cat
  • split
  • tac
  • tail
  • yes
)
0-168
38 continue;
never executed: continue;
0
39 else if (-
40 (*
(*__errno_location ()) == 22Description
TRUEevaluated 57 times by 1 test
Evaluated by:
  • tail
FALSEevaluated 111 times by 5 tests
Evaluated by:
  • cat
  • split
  • tac
  • tail
  • yes
__errno_location ())
(*__errno_location ()) == 22Description
TRUEevaluated 57 times by 1 test
Evaluated by:
  • tail
FALSEevaluated 111 times by 5 tests
Evaluated by:
  • cat
  • split
  • tac
  • tail
  • yes
57-111
41 ==
(*__errno_location ()) == 22Description
TRUEevaluated 57 times by 1 test
Evaluated by:
  • tail
FALSEevaluated 111 times by 5 tests
Evaluated by:
  • cat
  • split
  • tac
  • tail
  • yes
57-111
42 22
(*__errno_location ()) == 22Description
TRUEevaluated 57 times by 1 test
Evaluated by:
  • tail
FALSEevaluated 111 times by 5 tests
Evaluated by:
  • cat
  • split
  • tac
  • tail
  • yes
57-111
43 && BUGGY_READ_MAXIMUM < count
BUGGY_READ_MAXIMUM < countDescription
TRUEnever evaluated
FALSEevaluated 57 times by 1 test
Evaluated by:
  • tail
)
0-57
44 count = BUGGY_READ_MAXIMUM;
never executed: count = BUGGY_READ_MAXIMUM;
0
45 else-
46 return
executed 168 times by 5 tests: return result;
Executed by:
  • cat
  • split
  • tac
  • tail
  • yes
result;
executed 168 times by 5 tests: return result;
Executed by:
  • cat
  • split
  • tac
  • tail
  • yes
168
47 }-
48}
never executed: end of block
0
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2