Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/same.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||
5 | - | |||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||
7 | - | |||||||||||||||||||||||||
8 | - | |||||||||||||||||||||||||
9 | _Bool | - | ||||||||||||||||||||||||
10 | - | |||||||||||||||||||||||||
11 | same_name (const char *source, const char *dest) | - | ||||||||||||||||||||||||
12 | { | - | ||||||||||||||||||||||||
13 | return executed 70 times by 3 tests: same_nameat (return same_nameat ( -100 , source, -100 , dest); Executed by:
executed 70 times by 3 tests: return same_nameat ( -100 , source, -100 , dest); Executed by:
| 70 | ||||||||||||||||||||||||
14 | -100 executed 70 times by 3 tests: return same_nameat ( -100 , source, -100 , dest); Executed by:
| 70 | ||||||||||||||||||||||||
15 | , source, executed 70 times by 3 tests: return same_nameat ( -100 , source, -100 , dest); Executed by:
| 70 | ||||||||||||||||||||||||
16 | -100 executed 70 times by 3 tests: return same_nameat ( -100 , source, -100 , dest); Executed by:
| 70 | ||||||||||||||||||||||||
17 | , dest); executed 70 times by 3 tests: return same_nameat ( -100 , source, -100 , dest); Executed by:
| 70 | ||||||||||||||||||||||||
18 | } | - | ||||||||||||||||||||||||
19 | - | |||||||||||||||||||||||||
20 | - | |||||||||||||||||||||||||
21 | - | |||||||||||||||||||||||||
22 | - | |||||||||||||||||||||||||
23 | - | |||||||||||||||||||||||||
24 | _Bool | - | ||||||||||||||||||||||||
25 | - | |||||||||||||||||||||||||
26 | same_nameat (int source_dfd, char const *source, | - | ||||||||||||||||||||||||
27 | int dest_dfd, char const *dest) | - | ||||||||||||||||||||||||
28 | { | - | ||||||||||||||||||||||||
29 | - | |||||||||||||||||||||||||
30 | char const *source_basename = last_component (source); | - | ||||||||||||||||||||||||
31 | char const *dest_basename = last_component (dest); | - | ||||||||||||||||||||||||
32 | size_t source_baselen = base_len (source_basename); | - | ||||||||||||||||||||||||
33 | size_t dest_baselen = base_len (dest_basename); | - | ||||||||||||||||||||||||
34 | - | |||||||||||||||||||||||||
35 | _Bool | - | ||||||||||||||||||||||||
36 | identical_basenames = | - | ||||||||||||||||||||||||
37 | (source_baselen == dest_baselen
| 10-60 | ||||||||||||||||||||||||
38 | && memcmp (source_basename, dest_basename, dest_baselen) == 0
| 30 | ||||||||||||||||||||||||
39 | - | |||||||||||||||||||||||||
40 | _Bool | - | ||||||||||||||||||||||||
41 | compare_dirs = identical_basenames; | - | ||||||||||||||||||||||||
42 | - | |||||||||||||||||||||||||
43 | _Bool | - | ||||||||||||||||||||||||
44 | same = | - | ||||||||||||||||||||||||
45 | 0 | - | ||||||||||||||||||||||||
46 | ; | - | ||||||||||||||||||||||||
47 | if (compare_dirs
| 30-40 | ||||||||||||||||||||||||
48 | { | - | ||||||||||||||||||||||||
49 | struct stat source_dir_stats; | - | ||||||||||||||||||||||||
50 | struct stat dest_dir_stats; | - | ||||||||||||||||||||||||
51 | - | |||||||||||||||||||||||||
52 | - | |||||||||||||||||||||||||
53 | char *source_dirname = dir_name (source); | - | ||||||||||||||||||||||||
54 | int flags = | - | ||||||||||||||||||||||||
55 | 0x100 | - | ||||||||||||||||||||||||
56 | ; | - | ||||||||||||||||||||||||
57 | if (fstatat (source_dfd, source_dirname, &source_dir_stats, flags) != 0
| 0-30 | ||||||||||||||||||||||||
58 | { | - | ||||||||||||||||||||||||
59 | - | |||||||||||||||||||||||||
60 | error (1, | - | ||||||||||||||||||||||||
61 | (*__errno_location ()) | - | ||||||||||||||||||||||||
62 | , "%s", source_dirname); | - | ||||||||||||||||||||||||
63 | } never executed: end of block | 0 | ||||||||||||||||||||||||
64 | free (source_dirname); | - | ||||||||||||||||||||||||
65 | - | |||||||||||||||||||||||||
66 | char *dest_dirname = dir_name (dest); | - | ||||||||||||||||||||||||
67 | if (fstatat (dest_dfd, dest_dirname, &dest_dir_stats, flags) != 0
| 0-30 | ||||||||||||||||||||||||
68 | { | - | ||||||||||||||||||||||||
69 | - | |||||||||||||||||||||||||
70 | error (1, | - | ||||||||||||||||||||||||
71 | (*__errno_location ()) | - | ||||||||||||||||||||||||
72 | , "%s", dest_dirname); | - | ||||||||||||||||||||||||
73 | } never executed: end of block | 0 | ||||||||||||||||||||||||
74 | same = ((
| 0-26 | ||||||||||||||||||||||||
75 | - | |||||||||||||||||||||||||
76 | - | |||||||||||||||||||||||||
77 | free (dest_dirname); | - | ||||||||||||||||||||||||
78 | } executed 30 times by 3 tests: end of block Executed by:
| 30 | ||||||||||||||||||||||||
79 | - | |||||||||||||||||||||||||
80 | return executed 70 times by 3 tests: same;return same; Executed by:
executed 70 times by 3 tests: return same; Executed by:
| 70 | ||||||||||||||||||||||||
81 | } | - | ||||||||||||||||||||||||
Switch to Source code | Preprocessed file |