| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/set-permissions.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | int | - | ||||||||||||
| 4 | chmod_or_fchmod (const char *name, int desc, mode_t mode) | - | ||||||||||||
| 5 | { | - | ||||||||||||
| 6 | if (1 && desc != -1
| 3956-33951 | ||||||||||||
| 7 | return executed 3956 times by 3 tests: fchmod (desc, mode);return fchmod (desc, mode);Executed by:
executed 3956 times by 3 tests: return fchmod (desc, mode);Executed by:
| 3956 | ||||||||||||
| 8 | else | - | ||||||||||||
| 9 | return executed 33951 times by 2 tests: chmod (name, mode);return chmod (name, mode);Executed by:
executed 33951 times by 2 tests: return chmod (name, mode);Executed by:
| 33951 | ||||||||||||
| 10 | } | - | ||||||||||||
| 11 | int | - | ||||||||||||
| 12 | set_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
| 0-37907 | ||||||||||||
| 34 | { | - | ||||||||||||
| 35 | ret = chmod_or_fchmod (name, desc, ctx->mode); | - | ||||||||||||
| 36 | if (ret != 0
| 0-37907 | ||||||||||||
| 37 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||
| 38 | } executed 37907 times by 3 tests: end of blockExecuted by:
| 37907 | ||||||||||||
| 39 | if (must_chmod
| 0-37907 | ||||||||||||
| 40 | { | - | ||||||||||||
| 41 | int saved_errno = ret
| 0 | ||||||||||||
| 42 | (*__errno_location ()) | - | ||||||||||||
| 43 | : 0; | - | ||||||||||||
| 44 | - | |||||||||||||
| 45 | ret = chmod_or_fchmod (name, desc, ctx->mode); | - | ||||||||||||
| 46 | - | |||||||||||||
| 47 | if (saved_errno
| 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: ret;return ret;Executed by:
executed 37907 times by 3 tests: return ret;Executed by:
| 37907 | ||||||||||||
| 57 | } | - | ||||||||||||
| Switch to Source code | Preprocessed file |