OpenCoverage

fcntl.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/fcntl.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5int-
6rpl_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:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
executed 61028 times by 6 tests: case 1030 :
Executed by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
61028
20 1030
executed 61028 times by 6 tests: case 1030 :
Executed by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
61028
21 :
executed 61028 times by 6 tests: case 1030 :
Executed by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
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: -1
: 0;
-
33 if (0 <= have_dupfd_cloexec
0 <= have_dupfd_cloexecDescription
TRUEevaluated 61028 times by 6 tests
Evaluated by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
FALSEnever evaluated
)
0-61028
34 {-
35 result = fcntl (fd, action, target);-
36 if (0 <= result
0 <= resultDescription
TRUEevaluated 61028 times by 6 tests
Evaluated by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
FALSEnever evaluated
||
0-61028
37 (*
(*__errno_location ()) != 22Description
TRUEnever evaluated
FALSEnever evaluated
__errno_location ())
(*__errno_location ()) != 22Description
TRUEnever evaluated
FALSEnever evaluated
0
38 !=
(*__errno_location ()) != 22Description
TRUEnever evaluated
FALSEnever evaluated
0
39 22
(*__errno_location ()) != 22Description
TRUEnever evaluated
FALSEnever evaluated
0
40 )-
41 {-
42 have_dupfd_cloexec = 1;-
43-
44-
45-
46-
47 }
executed 61028 times by 6 tests: end of block
Executed by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
61028
48 else-
49 {-
50 result = rpl_fcntl (fd, -
51 0-
52 , target);-
53 if (result < 0
result < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
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 <= resultDescription
TRUEevaluated 61028 times by 6 tests
Evaluated by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
FALSEnever evaluated
&& have_dupfd_cloexec == -1
have_dupfd_cloexec == -1Description
TRUEnever evaluated
FALSEevaluated 61028 times by 6 tests
Evaluated by:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
)
0-61028
63 {-
64 int flags = fcntl (result, -
65 1-
66 );-
67 if (flags < 0
flags < 0Description
TRUEnever evaluated
FALSEnever evaluated
|| fcntl (result,
fcntl (result,...gs | 1 ) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
68 2
fcntl (result,...gs | 1 ) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
69 , flags |
fcntl (result,...gs | 1 ) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
70 1
fcntl (result,...gs | 1 ) == -1Description
TRUEnever evaluated
FALSEnever evaluated
0
71 ) == -1
fcntl (result,...gs | 1 ) == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
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:
  • chgrp
  • chmod
  • chown
  • du
  • mv
  • rm
61028
84-
85 }-
86 default
executed 115 times by 6 tests: default:
Executed by:
  • cp
  • dd
  • shred
  • sync
  • tac
  • tail
:
executed 115 times by 6 tests: default:
Executed by:
  • cp
  • dd
  • shred
  • sync
  • tac
  • tail
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:
  • cp
  • dd
  • shred
  • sync
  • tac
  • tail
115
101 }-
102 }-
103 -
104 __builtin_va_end(-
105 arg-
106 )-
107 ;-
108 return
executed 61143 times by 12 tests: return result;
Executed by:
  • chgrp
  • chmod
  • chown
  • cp
  • dd
  • du
  • mv
  • rm
  • shred
  • sync
  • tac
  • tail
result;
executed 61143 times by 12 tests: return result;
Executed by:
  • chgrp
  • chmod
  • chown
  • cp
  • dd
  • du
  • mv
  • rm
  • shred
  • sync
  • tac
  • tail
61143
109}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2