OpenCoverage

set-permissions.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/set-permissions.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3int-
4chmod_or_fchmod (const char *name, int desc, mode_t mode)-
5{-
6 if (1 && desc != -1
desc != -1Description
TRUEevaluated 3956 times by 3 tests
Evaluated by:
  • cp
  • ginstall
  • mv
FALSEevaluated 33951 times by 2 tests
Evaluated by:
  • cp
  • mv
)
3956-33951
7 return
executed 3956 times by 3 tests: return fchmod (desc, mode);
Executed by:
  • cp
  • ginstall
  • mv
fchmod (desc, mode);
executed 3956 times by 3 tests: return fchmod (desc, mode);
Executed by:
  • cp
  • ginstall
  • mv
3956
8 else-
9 return
executed 33951 times by 2 tests: return chmod (name, mode);
Executed by:
  • cp
  • mv
chmod (name, mode);
executed 33951 times by 2 tests: return chmod (name, mode);
Executed by:
  • cp
  • mv
33951
10}-
11int-
12set_permissions (struct permission_context *ctx, const char *name, int desc)-
13{-
14 -
15 _Bool -
16 acls_set __attribute__ ((__unused__)) = -
17 0-
18 ;-
19 -
20 _Bool -
21 early_chmod;-
22 -
23 _Bool -
24 must_chmod = -
25 0-
26 ;-
27 int ret = 0;-
28 early_chmod = -
29 1-
30 ;-
31-
32-
33 if (early_chmod
early_chmodDescription
TRUEevaluated 37907 times by 3 tests
Evaluated by:
  • cp
  • ginstall
  • mv
FALSEnever evaluated
)
0-37907
34 {-
35 ret = chmod_or_fchmod (name, desc, ctx->mode);-
36 if (ret != 0
ret != 0Description
TRUEnever evaluated
FALSEevaluated 37907 times by 3 tests
Evaluated by:
  • cp
  • ginstall
  • mv
)
0-37907
37 return
never executed: return -1;
-1;
never executed: return -1;
0
38 }
executed 37907 times by 3 tests: end of block
Executed by:
  • cp
  • ginstall
  • mv
37907
39 if (must_chmod
must_chmodDescription
TRUEnever evaluated
FALSEevaluated 37907 times by 3 tests
Evaluated by:
  • cp
  • ginstall
  • mv
&& ! early_chmod
! early_chmodDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-37907
40 {-
41 int saved_errno = ret
retDescription
TRUEnever evaluated
FALSEnever evaluated
?
0
42 (*__errno_location ()) -
43 : 0;-
44-
45 ret = chmod_or_fchmod (name, desc, ctx->mode);-
46-
47 if (saved_errno
saved_errnoDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
48 {-
49 -
50 (*__errno_location ()) -
51 = saved_errno;-
52 ret = -1;-
53 }
never executed: end of block
0
54 }
never executed: end of block
0
55-
56 return
executed 37907 times by 3 tests: return ret;
Executed by:
  • cp
  • ginstall
  • mv
ret;
executed 37907 times by 3 tests: return ret;
Executed by:
  • cp
  • ginstall
  • mv
37907
57}-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.1.2