Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/fcntl.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | int | - | ||||||||||||
6 | rpl_fcntl (int fd, int action, ...) | - | ||||||||||||
7 | { | - | ||||||||||||
8 | va_list arg; | - | ||||||||||||
9 | int result = -1; | - | ||||||||||||
10 | - | |||||||||||||
11 | __builtin_va_start( | - | ||||||||||||
12 | arg | - | ||||||||||||
13 | , | - | ||||||||||||
14 | action | - | ||||||||||||
15 | ) | - | ||||||||||||
16 | ; | - | ||||||||||||
17 | switch (action) | - | ||||||||||||
18 | { | - | ||||||||||||
19 | case executed 61028 times by 6 tests: case 1030 : Executed by:
executed 61028 times by 6 tests: case 1030 : Executed by:
| 61028 | ||||||||||||
20 | 1030 executed 61028 times by 6 tests: case 1030 : Executed by:
| 61028 | ||||||||||||
21 | : executed 61028 times by 6 tests: case 1030 : Executed by:
| 61028 | ||||||||||||
22 | { | - | ||||||||||||
23 | int target = | - | ||||||||||||
24 | __builtin_va_arg( | - | ||||||||||||
25 | arg | - | ||||||||||||
26 | , | - | ||||||||||||
27 | int | - | ||||||||||||
28 | ) | - | ||||||||||||
29 | ; | - | ||||||||||||
30 | static int have_dupfd_cloexec = | - | ||||||||||||
31 | 0 | - | ||||||||||||
32 | ? - dead code: 1-1 dead code: : 0;-1 | - | ||||||||||||
33 | if (0 <= have_dupfd_cloexec
| 0-61028 | ||||||||||||
34 | { | - | ||||||||||||
35 | result = fcntl (fd, action, target); | - | ||||||||||||
36 | if (0 <= result
| 0-61028 | ||||||||||||
37 | (*
| 0 | ||||||||||||
38 | !=
| 0 | ||||||||||||
39 | 22
| 0 | ||||||||||||
40 | ) | - | ||||||||||||
41 | { | - | ||||||||||||
42 | have_dupfd_cloexec = 1; | - | ||||||||||||
43 | - | |||||||||||||
44 | - | |||||||||||||
45 | - | |||||||||||||
46 | - | |||||||||||||
47 | } executed 61028 times by 6 tests: end of block Executed by:
| 61028 | ||||||||||||
48 | else | - | ||||||||||||
49 | { | - | ||||||||||||
50 | result = rpl_fcntl (fd, | - | ||||||||||||
51 | 0 | - | ||||||||||||
52 | , target); | - | ||||||||||||
53 | if (result < 0
| 0 | ||||||||||||
54 | break; never executed: break; | 0 | ||||||||||||
55 | have_dupfd_cloexec = -1; | - | ||||||||||||
56 | } never executed: end of block | 0 | ||||||||||||
57 | } | - | ||||||||||||
58 | else | - | ||||||||||||
59 | result = rpl_fcntl (fd, never executed: result = rpl_fcntl (fd, 0 , target); | 0 | ||||||||||||
60 | 0 never executed: result = rpl_fcntl (fd, 0 , target); | 0 | ||||||||||||
61 | , target); never executed: result = rpl_fcntl (fd, 0 , target); | 0 | ||||||||||||
62 | if (0 <= result
| 0-61028 | ||||||||||||
63 | { | - | ||||||||||||
64 | int flags = fcntl (result, | - | ||||||||||||
65 | 1 | - | ||||||||||||
66 | ); | - | ||||||||||||
67 | if (flags < 0
| 0 | ||||||||||||
68 | 2
| 0 | ||||||||||||
69 | , flags |
| 0 | ||||||||||||
70 | 1
| 0 | ||||||||||||
71 | ) == -1
| 0 | ||||||||||||
72 | { | - | ||||||||||||
73 | int saved_errno = | - | ||||||||||||
74 | (*__errno_location ()) | - | ||||||||||||
75 | ; | - | ||||||||||||
76 | close (result); | - | ||||||||||||
77 | - | |||||||||||||
78 | (*__errno_location ()) | - | ||||||||||||
79 | = saved_errno; | - | ||||||||||||
80 | result = -1; | - | ||||||||||||
81 | } never executed: end of block | 0 | ||||||||||||
82 | } never executed: end of block | 0 | ||||||||||||
83 | break; executed 61028 times by 6 tests: break; Executed by:
| 61028 | ||||||||||||
84 | - | |||||||||||||
85 | } | - | ||||||||||||
86 | default executed 115 times by 6 tests: :default: Executed by:
executed 115 times by 6 tests: default: Executed by:
| 115 | ||||||||||||
87 | { | - | ||||||||||||
88 | - | |||||||||||||
89 | void *p = | - | ||||||||||||
90 | __builtin_va_arg( | - | ||||||||||||
91 | arg | - | ||||||||||||
92 | , | - | ||||||||||||
93 | void * | - | ||||||||||||
94 | ) | - | ||||||||||||
95 | ; | - | ||||||||||||
96 | result = fcntl (fd, action, p); | - | ||||||||||||
97 | - | |||||||||||||
98 | - | |||||||||||||
99 | - | |||||||||||||
100 | break; executed 115 times by 6 tests: break; Executed by:
| 115 | ||||||||||||
101 | } | - | ||||||||||||
102 | } | - | ||||||||||||
103 | - | |||||||||||||
104 | __builtin_va_end( | - | ||||||||||||
105 | arg | - | ||||||||||||
106 | ) | - | ||||||||||||
107 | ; | - | ||||||||||||
108 | return executed 61143 times by 12 tests: result;return result; Executed by:
executed 61143 times by 12 tests: return result; Executed by:
| 61143 | ||||||||||||
109 | } | - | ||||||||||||
Switch to Source code | Preprocessed file |