Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/mkancesdirs.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||||||||
5 | ptrdiff_t | - | ||||||||||||||||||||||||||||||
6 | mkancesdirs (char *file, struct savewd *wd, | - | ||||||||||||||||||||||||||||||
7 | int (*make_dir) (char const *, char const *, void *), | - | ||||||||||||||||||||||||||||||
8 | void *make_dir_arg) | - | ||||||||||||||||||||||||||||||
9 | { | - | ||||||||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||||||||
11 | - | |||||||||||||||||||||||||||||||
12 | - | |||||||||||||||||||||||||||||||
13 | char *sep = | - | ||||||||||||||||||||||||||||||
14 | ((void *)0) | - | ||||||||||||||||||||||||||||||
15 | ; | - | ||||||||||||||||||||||||||||||
16 | - | |||||||||||||||||||||||||||||||
17 | - | |||||||||||||||||||||||||||||||
18 | - | |||||||||||||||||||||||||||||||
19 | char *component = file; | - | ||||||||||||||||||||||||||||||
20 | - | |||||||||||||||||||||||||||||||
21 | char *p = file + 0; | - | ||||||||||||||||||||||||||||||
22 | char c; | - | ||||||||||||||||||||||||||||||
23 | - | |||||||||||||||||||||||||||||||
24 | _Bool | - | ||||||||||||||||||||||||||||||
25 | made_dir = | - | ||||||||||||||||||||||||||||||
26 | 0 | - | ||||||||||||||||||||||||||||||
27 | ; | - | ||||||||||||||||||||||||||||||
28 | - | |||||||||||||||||||||||||||||||
29 | - | |||||||||||||||||||||||||||||||
30 | - | |||||||||||||||||||||||||||||||
31 | - | |||||||||||||||||||||||||||||||
32 | - | |||||||||||||||||||||||||||||||
33 | - | |||||||||||||||||||||||||||||||
34 | - | |||||||||||||||||||||||||||||||
35 | while ((
| 123-25026 | ||||||||||||||||||||||||||||||
36 | if (((*
| 12388-12638 | ||||||||||||||||||||||||||||||
37 | { | - | ||||||||||||||||||||||||||||||
38 | if (! ((c) == '/')
| 0-12388 | ||||||||||||||||||||||||||||||
39 | sep = p; executed 12388 times by 2 tests: sep = p; Executed by:
| 12388 | ||||||||||||||||||||||||||||||
40 | } executed 12388 times by 2 tests: end of block Executed by:
| 12388 | ||||||||||||||||||||||||||||||
41 | else if (((
| 3-12391 | ||||||||||||||||||||||||||||||
42 | { | - | ||||||||||||||||||||||||||||||
43 | - | |||||||||||||||||||||||||||||||
44 | - | |||||||||||||||||||||||||||||||
45 | if (! (sep - component == 1
| 0-12285 | ||||||||||||||||||||||||||||||
46 | { | - | ||||||||||||||||||||||||||||||
47 | int make_dir_errno = 0; | - | ||||||||||||||||||||||||||||||
48 | int savewd_chdir_options = 0; | - | ||||||||||||||||||||||||||||||
49 | int chdir_result; | - | ||||||||||||||||||||||||||||||
50 | - | |||||||||||||||||||||||||||||||
51 | - | |||||||||||||||||||||||||||||||
52 | - | |||||||||||||||||||||||||||||||
53 | *sep = '\0'; | - | ||||||||||||||||||||||||||||||
54 | - | |||||||||||||||||||||||||||||||
55 | - | |||||||||||||||||||||||||||||||
56 | - | |||||||||||||||||||||||||||||||
57 | if (sep - component == 2
| 2-12308 | ||||||||||||||||||||||||||||||
58 | && component[0] == '.'
| 0-2 | ||||||||||||||||||||||||||||||
59 | made_dir = never executed: made_dir = 0 ; | 0 | ||||||||||||||||||||||||||||||
60 | 0 never executed: made_dir = 0 ; | 0 | ||||||||||||||||||||||||||||||
61 | ; never executed: made_dir = 0 ; | 0 | ||||||||||||||||||||||||||||||
62 | else if (make_dir (file, component, make_dir_arg) < 0
| 172-12138 | ||||||||||||||||||||||||||||||
63 | make_dir_errno = executed 172 times by 2 tests: make_dir_errno = (*__errno_location ()) ; Executed by:
| 172 | ||||||||||||||||||||||||||||||
64 | (*__errno_location ()) executed 172 times by 2 tests: make_dir_errno = (*__errno_location ()) ; Executed by:
| 172 | ||||||||||||||||||||||||||||||
65 | ; executed 172 times by 2 tests: make_dir_errno = (*__errno_location ()) ; Executed by:
| 172 | ||||||||||||||||||||||||||||||
66 | else | - | ||||||||||||||||||||||||||||||
67 | made_dir = executed 12138 times by 2 tests: made_dir = 1 ; Executed by:
| 12138 | ||||||||||||||||||||||||||||||
68 | 1 executed 12138 times by 2 tests: made_dir = 1 ; Executed by:
| 12138 | ||||||||||||||||||||||||||||||
69 | ; executed 12138 times by 2 tests: made_dir = 1 ; Executed by:
| 12138 | ||||||||||||||||||||||||||||||
70 | - | |||||||||||||||||||||||||||||||
71 | if (made_dir
| 172-12138 | ||||||||||||||||||||||||||||||
72 | savewd_chdir_options |= SAVEWD_CHDIR_NOFOLLOW; executed 12138 times by 2 tests: savewd_chdir_options |= SAVEWD_CHDIR_NOFOLLOW; Executed by:
| 12138 | ||||||||||||||||||||||||||||||
73 | - | |||||||||||||||||||||||||||||||
74 | chdir_result = | - | ||||||||||||||||||||||||||||||
75 | savewd_chdir (wd, component, savewd_chdir_options, | - | ||||||||||||||||||||||||||||||
76 | ((void *)0) | - | ||||||||||||||||||||||||||||||
77 | ); | - | ||||||||||||||||||||||||||||||
78 | - | |||||||||||||||||||||||||||||||
79 | - | |||||||||||||||||||||||||||||||
80 | - | |||||||||||||||||||||||||||||||
81 | if (chdir_result != -1
| 1-12309 | ||||||||||||||||||||||||||||||
82 | * executed 12309 times by 2 tests: sep = '/';*sep = '/'; Executed by:
executed 12309 times by 2 tests: *sep = '/'; Executed by:
| 12309 | ||||||||||||||||||||||||||||||
83 | - | |||||||||||||||||||||||||||||||
84 | if (chdir_result != 0
| 5-12305 | ||||||||||||||||||||||||||||||
85 | { | - | ||||||||||||||||||||||||||||||
86 | if (make_dir_errno != 0
| 1-4 | ||||||||||||||||||||||||||||||
87 | (*
| 0-4 | ||||||||||||||||||||||||||||||
88 | ==
| 0-4 | ||||||||||||||||||||||||||||||
89 | 2
| 0-4 | ||||||||||||||||||||||||||||||
90 | ) | - | ||||||||||||||||||||||||||||||
91 | - | |||||||||||||||||||||||||||||||
92 | (* never executed: __errno_location ()) (*__errno_location ()) = make_dir_errno; never executed: (*__errno_location ()) = make_dir_errno; | 0 | ||||||||||||||||||||||||||||||
93 | = make_dir_errno; never executed: (*__errno_location ()) = make_dir_errno; | 0 | ||||||||||||||||||||||||||||||
94 | return executed 5 times by 1 test: chdir_result;return chdir_result; Executed by:
executed 5 times by 1 test: return chdir_result; Executed by:
| 5 | ||||||||||||||||||||||||||||||
95 | } | - | ||||||||||||||||||||||||||||||
96 | } executed 12305 times by 2 tests: end of block Executed by:
| 12305 | ||||||||||||||||||||||||||||||
97 | - | |||||||||||||||||||||||||||||||
98 | component = p; | - | ||||||||||||||||||||||||||||||
99 | } executed 12305 times by 2 tests: end of block Executed by:
| 12305 | ||||||||||||||||||||||||||||||
100 | - | |||||||||||||||||||||||||||||||
101 | return executed 123 times by 2 tests: component - file;return component - file; Executed by:
executed 123 times by 2 tests: return component - file; Executed by:
| 123 | ||||||||||||||||||||||||||||||
102 | } | - | ||||||||||||||||||||||||||||||
Switch to Source code | Preprocessed file |