| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/save-cwd.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | - | |||||||
| 6 | int | - | ||||||
| 7 | save_cwd (struct saved_cwd *cwd) | - | ||||||
| 8 | { | - | ||||||
| 9 | cwd->name = | - | ||||||
| 10 | ((void *)0) | - | ||||||
| 11 | ; | - | ||||||
| 12 | - | |||||||
| 13 | cwd->desc = open_safer (".", | - | ||||||
| 14 | 00 | - | ||||||
| 15 | | | - | ||||||
| 16 | 02000000 | - | ||||||
| 17 | ); | - | ||||||
| 18 | if (!1
| - | ||||||
| 19 | cwd->desc = fd_safer_flag (cwd->desc, dead code: cwd->desc = fd_safer_flag (cwd->desc, 02000000 ); | - | ||||||
| 20 | 02000000 dead code: cwd->desc = fd_safer_flag (cwd->desc, 02000000 ); | - | ||||||
| 21 | ); dead code: cwd->desc = fd_safer_flag (cwd->desc, 02000000 ); | - | ||||||
| 22 | if (cwd->desc < 0
| 0-6 | ||||||
| 23 | { | - | ||||||
| 24 | cwd->name = getcwd ( | - | ||||||
| 25 | ((void *)0) | - | ||||||
| 26 | , 0); | - | ||||||
| 27 | return never executed: cwd->name ? 0 : -1;return cwd->name ? 0 : -1;never executed: return cwd->name ? 0 : -1; | 0 | ||||||
| 28 | } | - | ||||||
| 29 | - | |||||||
| 30 | return executed 6 times by 2 tests: 0;return 0;Executed by:
executed 6 times by 2 tests: return 0;Executed by:
| 6 | ||||||
| 31 | } | - | ||||||
| 32 | - | |||||||
| 33 | - | |||||||
| 34 | - | |||||||
| 35 | - | |||||||
| 36 | - | |||||||
| 37 | int | - | ||||||
| 38 | restore_cwd (const struct saved_cwd *cwd) | - | ||||||
| 39 | { | - | ||||||
| 40 | if (0 <= cwd->desc
| 0-6 | ||||||
| 41 | return executed 6 times by 2 tests: fchdir (cwd->desc);return fchdir (cwd->desc);Executed by:
executed 6 times by 2 tests: return fchdir (cwd->desc);Executed by:
| 6 | ||||||
| 42 | else | - | ||||||
| 43 | return never executed: chdir_long (cwd->name);return chdir_long (cwd->name);never executed: return chdir_long (cwd->name); | 0 | ||||||
| 44 | } | - | ||||||
| 45 | - | |||||||
| 46 | void | - | ||||||
| 47 | free_cwd (struct saved_cwd *cwd) | - | ||||||
| 48 | { | - | ||||||
| 49 | if (cwd->desc >= 0
| 0-6 | ||||||
| 50 | close (cwd->desc); executed 6 times by 2 tests: close (cwd->desc);Executed by:
| 6 | ||||||
| 51 | free (cwd->name); | - | ||||||
| 52 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||
| Switch to Source code | Preprocessed file |