| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/remove.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||||||||
| 3 | enum Ternary | - | ||||||||||||||||||||||||||||||||||||
| 4 | { | - | ||||||||||||||||||||||||||||||||||||
| 5 | T_UNKNOWN = 2, | - | ||||||||||||||||||||||||||||||||||||
| 6 | T_NO, | - | ||||||||||||||||||||||||||||||||||||
| 7 | T_YES | - | ||||||||||||||||||||||||||||||||||||
| 8 | }; | - | ||||||||||||||||||||||||||||||||||||
| 9 | typedef enum Ternary Ternary; | - | ||||||||||||||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||||||||||||||
| 14 | enum Prompt_action | - | ||||||||||||||||||||||||||||||||||||
| 15 | { | - | ||||||||||||||||||||||||||||||||||||
| 16 | PA_DESCEND_INTO_DIR = 2, | - | ||||||||||||||||||||||||||||||||||||
| 17 | PA_REMOVE_DIR | - | ||||||||||||||||||||||||||||||||||||
| 18 | }; | - | ||||||||||||||||||||||||||||||||||||
| 19 | static int | - | ||||||||||||||||||||||||||||||||||||
| 20 | cache_fstatat (int fd, char const *file, struct stat *st, int flag) | - | ||||||||||||||||||||||||||||||||||||
| 21 | { | - | ||||||||||||||||||||||||||||||||||||
| 22 | if (st->st_size == -1
| 0-143 | ||||||||||||||||||||||||||||||||||||
| 23 | { | - | ||||||||||||||||||||||||||||||||||||
| 24 | st->st_size = -2; | - | ||||||||||||||||||||||||||||||||||||
| 25 | st->st_ino = | - | ||||||||||||||||||||||||||||||||||||
| 26 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 27 | ; | - | ||||||||||||||||||||||||||||||||||||
| 28 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 29 | if (0 <= st->st_size
| 0-187 | ||||||||||||||||||||||||||||||||||||
| 30 | return executed 187 times by 1 test: 0;return 0;Executed by:
executed 187 times by 1 test: return 0;Executed by:
| 187 | ||||||||||||||||||||||||||||||||||||
| 31 | - | |||||||||||||||||||||||||||||||||||||
| 32 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 33 | = (int) st->st_ino; | - | ||||||||||||||||||||||||||||||||||||
| 34 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||
| 35 | } | - | ||||||||||||||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||||||||||||||
| 37 | - | |||||||||||||||||||||||||||||||||||||
| 38 | static inline struct stat * | - | ||||||||||||||||||||||||||||||||||||
| 39 | cache_stat_init (struct stat *st) | - | ||||||||||||||||||||||||||||||||||||
| 40 | { | - | ||||||||||||||||||||||||||||||||||||
| 41 | st->st_size = -1; | - | ||||||||||||||||||||||||||||||||||||
| 42 | return executed 322552 times by 2 tests: st;return st;Executed by:
executed 322552 times by 2 tests: return st;Executed by:
| 322552 | ||||||||||||||||||||||||||||||||||||
| 43 | } | - | ||||||||||||||||||||||||||||||||||||
| 44 | - | |||||||||||||||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||||||||||||||
| 46 | - | |||||||||||||||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||||||||||||||
| 48 | - | |||||||||||||||||||||||||||||||||||||
| 49 | static int | - | ||||||||||||||||||||||||||||||||||||
| 50 | write_protected_non_symlink (int fd_cwd, | - | ||||||||||||||||||||||||||||||||||||
| 51 | char const *file, | - | ||||||||||||||||||||||||||||||||||||
| 52 | struct stat *buf) | - | ||||||||||||||||||||||||||||||||||||
| 53 | { | - | ||||||||||||||||||||||||||||||||||||
| 54 | if (can_write_any_file ()
| 0-143 | ||||||||||||||||||||||||||||||||||||
| 55 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||||||||
| 56 | if (cache_fstatat (fd_cwd, file, buf,
| 0-143 | ||||||||||||||||||||||||||||||||||||
| 57 | 0x100
| 0-143 | ||||||||||||||||||||||||||||||||||||
| 58 | ) != 0
| 0-143 | ||||||||||||||||||||||||||||||||||||
| 59 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||||||||||||||
| 60 | if ( | - | ||||||||||||||||||||||||||||||||||||
| 61 | ((((
| 4-139 | ||||||||||||||||||||||||||||||||||||
| 62 | buf->st_mode
| 4-139 | ||||||||||||||||||||||||||||||||||||
| 63 | )) & 0170000) == (0120000))
| 4-139 | ||||||||||||||||||||||||||||||||||||
| 64 | ) | - | ||||||||||||||||||||||||||||||||||||
| 65 | return executed 4 times by 1 test: 0;return 0;Executed by:
executed 4 times by 1 test: return 0;Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 66 | { | - | ||||||||||||||||||||||||||||||||||||
| 67 | if (faccessat (fd_cwd, file,
| 6-133 | ||||||||||||||||||||||||||||||||||||
| 68 | 2
| 6-133 | ||||||||||||||||||||||||||||||||||||
| 69 | ,
| 6-133 | ||||||||||||||||||||||||||||||||||||
| 70 | 0x200
| 6-133 | ||||||||||||||||||||||||||||||||||||
| 71 | ) == 0
| 6-133 | ||||||||||||||||||||||||||||||||||||
| 72 | return executed 133 times by 1 test: 0;return 0;Executed by:
executed 133 times by 1 test: return 0;Executed by:
| 133 | ||||||||||||||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||||||||||||||
| 74 | return executed 6 times by 1 test: return (*__errno_location ()) == 13 ? 1 : -1;Executed by:
executed 6 times by 1 test: return (*__errno_location ()) == 13 ? 1 : -1;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 75 | (*__errno_location ()) executed 6 times by 1 test: return (*__errno_location ()) == 13 ? 1 : -1;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 76 | == executed 6 times by 1 test: return (*__errno_location ()) == 13 ? 1 : -1;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 77 | 13 executed 6 times by 1 test: return (*__errno_location ()) == 13 ? 1 : -1;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 78 | ? 1 : -1; executed 6 times by 1 test: return (*__errno_location ()) == 13 ? 1 : -1;Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 79 | } | - | ||||||||||||||||||||||||||||||||||||
| 80 | } | - | ||||||||||||||||||||||||||||||||||||
| 81 | static enum RM_status | - | ||||||||||||||||||||||||||||||||||||
| 82 | prompt (FTS const *fts, FTSENT const *ent, | - | ||||||||||||||||||||||||||||||||||||
| 83 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 84 | is_dir, | - | ||||||||||||||||||||||||||||||||||||
| 85 | struct rm_options const *x, enum Prompt_action mode, | - | ||||||||||||||||||||||||||||||||||||
| 86 | Ternary *is_empty_p) | - | ||||||||||||||||||||||||||||||||||||
| 87 | { | - | ||||||||||||||||||||||||||||||||||||
| 88 | int fd_cwd = fts->fts_cwd_fd; | - | ||||||||||||||||||||||||||||||||||||
| 89 | char const *full_name = ent->fts_path; | - | ||||||||||||||||||||||||||||||||||||
| 90 | char const *filename = ent->fts_accpath; | - | ||||||||||||||||||||||||||||||||||||
| 91 | if (is_empty_p
| 56489-266063 | ||||||||||||||||||||||||||||||||||||
| 92 | * executed 56489 times by 2 tests: is_empty_p = T_UNKNOWN;*is_empty_p = T_UNKNOWN;Executed by:
executed 56489 times by 2 tests: *is_empty_p = T_UNKNOWN;Executed by:
| 56489 | ||||||||||||||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||||||||||||||
| 94 | struct stat st; | - | ||||||||||||||||||||||||||||||||||||
| 95 | struct stat *sbuf = &st; | - | ||||||||||||||||||||||||||||||||||||
| 96 | cache_stat_init (sbuf); | - | ||||||||||||||||||||||||||||||||||||
| 97 | - | |||||||||||||||||||||||||||||||||||||
| 98 | int dirent_type = is_dir
| 72734-249818 | ||||||||||||||||||||||||||||||||||||
| 99 | DT_DIR | - | ||||||||||||||||||||||||||||||||||||
| 100 | : | - | ||||||||||||||||||||||||||||||||||||
| 101 | DT_UNKNOWN | - | ||||||||||||||||||||||||||||||||||||
| 102 | ; | - | ||||||||||||||||||||||||||||||||||||
| 103 | int write_protected = 0; | - | ||||||||||||||||||||||||||||||||||||
| 104 | - | |||||||||||||||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||||||||||||||
| 106 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 107 | is_empty = | - | ||||||||||||||||||||||||||||||||||||
| 108 | 0 | - | ||||||||||||||||||||||||||||||||||||
| 109 | ; | - | ||||||||||||||||||||||||||||||||||||
| 110 | if (is_empty_p
| 56489-266063 | ||||||||||||||||||||||||||||||||||||
| 111 | { | - | ||||||||||||||||||||||||||||||||||||
| 112 | is_empty = is_empty_dir (fd_cwd, filename); | - | ||||||||||||||||||||||||||||||||||||
| 113 | *is_empty_p = is_empty
| 16247-40242 | ||||||||||||||||||||||||||||||||||||
| 114 | } executed 56489 times by 2 tests: end of blockExecuted by:
| 56489 | ||||||||||||||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||||||||||||||
| 116 | - | |||||||||||||||||||||||||||||||||||||
| 117 | - | |||||||||||||||||||||||||||||||||||||
| 118 | - | |||||||||||||||||||||||||||||||||||||
| 119 | if (ent->fts_number
| 9-322543 | ||||||||||||||||||||||||||||||||||||
| 120 | return executed 9 times by 1 test: RM_USER_DECLINED;return RM_USER_DECLINED;Executed by:
executed 9 times by 1 test: return RM_USER_DECLINED;Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||
| 121 | - | |||||||||||||||||||||||||||||||||||||
| 122 | if (x->interactive == RMI_NEVER
| 24494-298049 | ||||||||||||||||||||||||||||||||||||
| 123 | return executed 298049 times by 2 tests: RM_OK;return RM_OK;Executed by:
executed 298049 times by 2 tests: return RM_OK;Executed by:
| 298049 | ||||||||||||||||||||||||||||||||||||
| 124 | - | |||||||||||||||||||||||||||||||||||||
| 125 | int wp_errno = 0; | - | ||||||||||||||||||||||||||||||||||||
| 126 | if (!x->ignore_missing_files
| 0-24494 | ||||||||||||||||||||||||||||||||||||
| 127 | && ((
| 30-24464 | ||||||||||||||||||||||||||||||||||||
| 128 | && dirent_type !=
| 0-143 | ||||||||||||||||||||||||||||||||||||
| 129 | DT_LNK
| 0-143 | ||||||||||||||||||||||||||||||||||||
| 130 | ) | - | ||||||||||||||||||||||||||||||||||||
| 131 | { | - | ||||||||||||||||||||||||||||||||||||
| 132 | write_protected = write_protected_non_symlink (fd_cwd, filename, sbuf); | - | ||||||||||||||||||||||||||||||||||||
| 133 | wp_errno = | - | ||||||||||||||||||||||||||||||||||||
| 134 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 135 | ; | - | ||||||||||||||||||||||||||||||||||||
| 136 | } executed 143 times by 1 test: end of blockExecuted by:
| 143 | ||||||||||||||||||||||||||||||||||||
| 137 | - | |||||||||||||||||||||||||||||||||||||
| 138 | if (write_protected
| 6-24488 | ||||||||||||||||||||||||||||||||||||
| 139 | { | - | ||||||||||||||||||||||||||||||||||||
| 140 | if (0 <= write_protected
| 0-33 | ||||||||||||||||||||||||||||||||||||
| 141 | DT_UNKNOWN
| 16-17 | ||||||||||||||||||||||||||||||||||||
| 142 | ) | - | ||||||||||||||||||||||||||||||||||||
| 143 | { | - | ||||||||||||||||||||||||||||||||||||
| 144 | if (cache_fstatat (fd_cwd, filename, sbuf,
| 0-17 | ||||||||||||||||||||||||||||||||||||
| 145 | 0x100
| 0-17 | ||||||||||||||||||||||||||||||||||||
| 146 | ) == 0
| 0-17 | ||||||||||||||||||||||||||||||||||||
| 147 | { | - | ||||||||||||||||||||||||||||||||||||
| 148 | if ( | - | ||||||||||||||||||||||||||||||||||||
| 149 | ((((
| 2-15 | ||||||||||||||||||||||||||||||||||||
| 150 | sbuf->st_mode
| 2-15 | ||||||||||||||||||||||||||||||||||||
| 151 | )) & 0170000) == (0120000))
| 2-15 | ||||||||||||||||||||||||||||||||||||
| 152 | ) | - | ||||||||||||||||||||||||||||||||||||
| 153 | dirent_type = executed 2 times by 1 test: dirent_type = DT_LNK ;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 154 | DT_LNK executed 2 times by 1 test: dirent_type = DT_LNK ;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 155 | ; executed 2 times by 1 test: dirent_type = DT_LNK ;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 156 | else if ( | - | ||||||||||||||||||||||||||||||||||||
| 157 | ((((
| 0-15 | ||||||||||||||||||||||||||||||||||||
| 158 | sbuf->st_mode
| 0-15 | ||||||||||||||||||||||||||||||||||||
| 159 | )) & 0170000) == (0040000))
| 0-15 | ||||||||||||||||||||||||||||||||||||
| 160 | ) | - | ||||||||||||||||||||||||||||||||||||
| 161 | dirent_type = never executed: dirent_type = DT_DIR ; | 0 | ||||||||||||||||||||||||||||||||||||
| 162 | DT_DIR never executed: dirent_type = DT_DIR ; | 0 | ||||||||||||||||||||||||||||||||||||
| 163 | ; never executed: dirent_type = DT_DIR ; | 0 | ||||||||||||||||||||||||||||||||||||
| 164 | - | |||||||||||||||||||||||||||||||||||||
| 165 | } executed 17 times by 1 test: end of blockExecuted by:
| 17 | ||||||||||||||||||||||||||||||||||||
| 166 | else | - | ||||||||||||||||||||||||||||||||||||
| 167 | { | - | ||||||||||||||||||||||||||||||||||||
| 168 | - | |||||||||||||||||||||||||||||||||||||
| 169 | write_protected = -1; | - | ||||||||||||||||||||||||||||||||||||
| 170 | wp_errno = | - | ||||||||||||||||||||||||||||||||||||
| 171 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 172 | ; | - | ||||||||||||||||||||||||||||||||||||
| 173 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 174 | } | - | ||||||||||||||||||||||||||||||||||||
| 175 | - | |||||||||||||||||||||||||||||||||||||
| 176 | if (0 <= write_protected
| 0-33 | ||||||||||||||||||||||||||||||||||||
| 177 | switch (dirent_type) | - | ||||||||||||||||||||||||||||||||||||
| 178 | { | - | ||||||||||||||||||||||||||||||||||||
| 179 | case executed 2 times by 1 test: case DT_LNK :Executed by:
executed 2 times by 1 test: case DT_LNK :Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 180 | DT_LNK executed 2 times by 1 test: case DT_LNK :Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 181 | : executed 2 times by 1 test: case DT_LNK :Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 182 | - | |||||||||||||||||||||||||||||||||||||
| 183 | if (x->interactive != RMI_ALWAYS
| 0-2 | ||||||||||||||||||||||||||||||||||||
| 184 | return never executed: RM_OK;return RM_OK;never executed: return RM_OK; | 0 | ||||||||||||||||||||||||||||||||||||
| 185 | break; executed 2 times by 1 test: break;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 186 | - | |||||||||||||||||||||||||||||||||||||
| 187 | case executed 16 times by 1 test: case DT_DIR :Executed by:
executed 16 times by 1 test: case DT_DIR :Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 188 | DT_DIR executed 16 times by 1 test: case DT_DIR :Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 189 | : executed 16 times by 1 test: case DT_DIR :Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 190 | - | |||||||||||||||||||||||||||||||||||||
| 191 | - | |||||||||||||||||||||||||||||||||||||
| 192 | - | |||||||||||||||||||||||||||||||||||||
| 193 | if ( ! (x->recursive
| 0-15 | ||||||||||||||||||||||||||||||||||||
| 194 | { | - | ||||||||||||||||||||||||||||||||||||
| 195 | write_protected = -1; | - | ||||||||||||||||||||||||||||||||||||
| 196 | wp_errno = | - | ||||||||||||||||||||||||||||||||||||
| 197 | 21 | - | ||||||||||||||||||||||||||||||||||||
| 198 | ; | - | ||||||||||||||||||||||||||||||||||||
| 199 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 200 | break; executed 16 times by 1 test: break;Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 201 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 202 | - | |||||||||||||||||||||||||||||||||||||
| 203 | char const *quoted_name = quotearg_style (shell_escape_always_quoting_style, full_name); | - | ||||||||||||||||||||||||||||||||||||
| 204 | - | |||||||||||||||||||||||||||||||||||||
| 205 | if (write_protected < 0
| 0-33 | ||||||||||||||||||||||||||||||||||||
| 206 | { | - | ||||||||||||||||||||||||||||||||||||
| 207 | error (0, wp_errno, | - | ||||||||||||||||||||||||||||||||||||
| 208 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 209 | "cannot remove %s" | - | ||||||||||||||||||||||||||||||||||||
| 210 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 211 | , quoted_name); | - | ||||||||||||||||||||||||||||||||||||
| 212 | return never executed: RM_ERROR;return RM_ERROR;never executed: return RM_ERROR; | 0 | ||||||||||||||||||||||||||||||||||||
| 213 | } | - | ||||||||||||||||||||||||||||||||||||
| 214 | - | |||||||||||||||||||||||||||||||||||||
| 215 | - | |||||||||||||||||||||||||||||||||||||
| 216 | if (dirent_type ==
| 16-17 | ||||||||||||||||||||||||||||||||||||
| 217 | DT_DIR
| 16-17 | ||||||||||||||||||||||||||||||||||||
| 218 | - | |||||||||||||||||||||||||||||||||||||
| 219 | && mode == PA_DESCEND_INTO_DIR
| 6-10 | ||||||||||||||||||||||||||||||||||||
| 220 | && !is_empty
| 4-6 | ||||||||||||||||||||||||||||||||||||
| 221 | fprintf ( executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 222 | stderr executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 223 | , executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 224 | (write_protected executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 225 | ? executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 226 | dcgettext (((void *)0), executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 227 | "%s: descend into write-protected directory %s? " executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 228 | , 5) executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 229 | executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 230 | : executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 231 | dcgettext (((void *)0), executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 232 | "%s: descend into directory %s? " executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 233 | , 5) executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 234 | ), executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 235 | program_name, quoted_name); executed 6 times by 1 test: fprintf ( stderr , (write_protected ? dcgettext (((void *)0), "%s: descend into write-protected directory %s? " , 5) : dcgettext (((void *)0), "%s: descend into directory %s? " , 5) ), program_name, quoted_name);Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 236 | else | - | ||||||||||||||||||||||||||||||||||||
| 237 | { | - | ||||||||||||||||||||||||||||||||||||
| 238 | if (cache_fstatat (fd_cwd, filename, sbuf,
| 0-27 | ||||||||||||||||||||||||||||||||||||
| 239 | 0x100
| 0-27 | ||||||||||||||||||||||||||||||||||||
| 240 | ) != 0
| 0-27 | ||||||||||||||||||||||||||||||||||||
| 241 | { | - | ||||||||||||||||||||||||||||||||||||
| 242 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 243 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 244 | , | - | ||||||||||||||||||||||||||||||||||||
| 245 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 246 | "cannot remove %s" | - | ||||||||||||||||||||||||||||||||||||
| 247 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 248 | , quoted_name); | - | ||||||||||||||||||||||||||||||||||||
| 249 | return never executed: RM_ERROR;return RM_ERROR;never executed: return RM_ERROR; | 0 | ||||||||||||||||||||||||||||||||||||
| 250 | } | - | ||||||||||||||||||||||||||||||||||||
| 251 | - | |||||||||||||||||||||||||||||||||||||
| 252 | fprintf ( | - | ||||||||||||||||||||||||||||||||||||
| 253 | stderr | - | ||||||||||||||||||||||||||||||||||||
| 254 | , | - | ||||||||||||||||||||||||||||||||||||
| 255 | (write_protected | - | ||||||||||||||||||||||||||||||||||||
| 256 | - | |||||||||||||||||||||||||||||||||||||
| 257 | - | |||||||||||||||||||||||||||||||||||||
| 258 | - | |||||||||||||||||||||||||||||||||||||
| 259 | - | |||||||||||||||||||||||||||||||||||||
| 260 | - | |||||||||||||||||||||||||||||||||||||
| 261 | ? | - | ||||||||||||||||||||||||||||||||||||
| 262 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 263 | "%s: remove write-protected %s %s? " | - | ||||||||||||||||||||||||||||||||||||
| 264 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||||||||||||||
| 266 | : | - | ||||||||||||||||||||||||||||||||||||
| 267 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 268 | "%s: remove %s %s? " | - | ||||||||||||||||||||||||||||||||||||
| 269 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 270 | ), | - | ||||||||||||||||||||||||||||||||||||
| 271 | program_name, file_type (sbuf), quoted_name); | - | ||||||||||||||||||||||||||||||||||||
| 272 | } executed 27 times by 1 test: end of blockExecuted by:
| 27 | ||||||||||||||||||||||||||||||||||||
| 273 | - | |||||||||||||||||||||||||||||||||||||
| 274 | if (!yesno ()
| 9-24 | ||||||||||||||||||||||||||||||||||||
| 275 | return executed 9 times by 1 test: RM_USER_DECLINED;return RM_USER_DECLINED;Executed by:
executed 9 times by 1 test: return RM_USER_DECLINED;Executed by:
| 9 | ||||||||||||||||||||||||||||||||||||
| 276 | } executed 24 times by 1 test: end of blockExecuted by:
| 24 | ||||||||||||||||||||||||||||||||||||
| 277 | return executed 24485 times by 1 test: RM_OK;return RM_OK;Executed by:
executed 24485 times by 1 test: return RM_OK;Executed by:
| 24485 | ||||||||||||||||||||||||||||||||||||
| 278 | } | - | ||||||||||||||||||||||||||||||||||||
| 279 | - | |||||||||||||||||||||||||||||||||||||
| 280 | - | |||||||||||||||||||||||||||||||||||||
| 281 | - | |||||||||||||||||||||||||||||||||||||
| 282 | - | |||||||||||||||||||||||||||||||||||||
| 283 | static inline | - | ||||||||||||||||||||||||||||||||||||
| 284 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 285 | - | |||||||||||||||||||||||||||||||||||||
| 286 | nonexistent_file_errno (int errnum) | - | ||||||||||||||||||||||||||||||||||||
| 287 | { | - | ||||||||||||||||||||||||||||||||||||
| 288 | switch (errnum) | - | ||||||||||||||||||||||||||||||||||||
| 289 | { | - | ||||||||||||||||||||||||||||||||||||
| 290 | case never executed: case 84 :never executed: case 84 : | 0 | ||||||||||||||||||||||||||||||||||||
| 291 | 84 never executed: case 84 : | 0 | ||||||||||||||||||||||||||||||||||||
| 292 | : never executed: case 84 : | 0 | ||||||||||||||||||||||||||||||||||||
| 293 | case never executed: case 22 :never executed: case 22 : | 0 | ||||||||||||||||||||||||||||||||||||
| 294 | 22 never executed: case 22 : | 0 | ||||||||||||||||||||||||||||||||||||
| 295 | : never executed: case 22 : | 0 | ||||||||||||||||||||||||||||||||||||
| 296 | case executed 492 times by 1 test: case 2 :Executed by:
executed 492 times by 1 test: case 2 :Executed by:
| 492 | ||||||||||||||||||||||||||||||||||||
| 297 | 2 executed 492 times by 1 test: case 2 :Executed by:
| 492 | ||||||||||||||||||||||||||||||||||||
| 298 | : executed 492 times by 1 test: case 2 :Executed by:
| 492 | ||||||||||||||||||||||||||||||||||||
| 299 | case executed 1 time by 1 test: case 20 :Executed by:
executed 1 time by 1 test: case 20 :Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 300 | 20 executed 1 time by 1 test: case 20 :Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 301 | : executed 1 time by 1 test: case 20 :Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 302 | return executed 493 times by 1 test: return 1 ;Executed by:
executed 493 times by 1 test: return 1 ;Executed by:
| 493 | ||||||||||||||||||||||||||||||||||||
| 303 | 1 executed 493 times by 1 test: return 1 ;Executed by:
| 493 | ||||||||||||||||||||||||||||||||||||
| 304 | ; executed 493 times by 1 test: return 1 ;Executed by:
| 493 | ||||||||||||||||||||||||||||||||||||
| 305 | default executed 11 times by 1 test: :default:Executed by:
executed 11 times by 1 test: default:Executed by:
| 11 | ||||||||||||||||||||||||||||||||||||
| 306 | return executed 11 times by 1 test: return 0 ;Executed by:
executed 11 times by 1 test: return 0 ;Executed by:
| 11 | ||||||||||||||||||||||||||||||||||||
| 307 | 0 executed 11 times by 1 test: return 0 ;Executed by:
| 11 | ||||||||||||||||||||||||||||||||||||
| 308 | ; executed 11 times by 1 test: return 0 ;Executed by:
| 11 | ||||||||||||||||||||||||||||||||||||
| 309 | } | - | ||||||||||||||||||||||||||||||||||||
| 310 | } | - | ||||||||||||||||||||||||||||||||||||
| 311 | - | |||||||||||||||||||||||||||||||||||||
| 312 | - | |||||||||||||||||||||||||||||||||||||
| 313 | static inline | - | ||||||||||||||||||||||||||||||||||||
| 314 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 315 | - | |||||||||||||||||||||||||||||||||||||
| 316 | ignorable_missing (struct rm_options const *x, int errnum) | - | ||||||||||||||||||||||||||||||||||||
| 317 | { | - | ||||||||||||||||||||||||||||||||||||
| 318 | return executed 509 times by 1 test: x->ignore_missing_files && nonexistent_file_errno (errnum);return x->ignore_missing_files && nonexistent_file_errno (errnum);Executed by:
executed 509 times by 1 test: return x->ignore_missing_files && nonexistent_file_errno (errnum);Executed by:
| 509 | ||||||||||||||||||||||||||||||||||||
| 319 | } | - | ||||||||||||||||||||||||||||||||||||
| 320 | - | |||||||||||||||||||||||||||||||||||||
| 321 | - | |||||||||||||||||||||||||||||||||||||
| 322 | static void | - | ||||||||||||||||||||||||||||||||||||
| 323 | fts_skip_tree (FTS *fts, FTSENT *ent) | - | ||||||||||||||||||||||||||||||||||||
| 324 | { | - | ||||||||||||||||||||||||||||||||||||
| 325 | fts_set (fts, ent, 4); | - | ||||||||||||||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||||||||||||||
| 327 | (__extension__ ({ __typeof__ (fts_read (fts)) __x = (fts_read (fts)); (void) __x; })); | - | ||||||||||||||||||||||||||||||||||||
| 328 | } executed 40254 times by 2 tests: end of blockExecuted by:
| 40254 | ||||||||||||||||||||||||||||||||||||
| 329 | - | |||||||||||||||||||||||||||||||||||||
| 330 | - | |||||||||||||||||||||||||||||||||||||
| 331 | - | |||||||||||||||||||||||||||||||||||||
| 332 | - | |||||||||||||||||||||||||||||||||||||
| 333 | static void | - | ||||||||||||||||||||||||||||||||||||
| 334 | mark_ancestor_dirs (FTSENT *ent) | - | ||||||||||||||||||||||||||||||||||||
| 335 | { | - | ||||||||||||||||||||||||||||||||||||
| 336 | FTSENT *p; | - | ||||||||||||||||||||||||||||||||||||
| 337 | for (p = ent->fts_parent; 0 <= p->fts_level
| 11-21 | ||||||||||||||||||||||||||||||||||||
| 338 | { | - | ||||||||||||||||||||||||||||||||||||
| 339 | if (p->fts_number
| 1-10 | ||||||||||||||||||||||||||||||||||||
| 340 | break; executed 1 time by 1 test: break;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 341 | p->fts_number = 1; | - | ||||||||||||||||||||||||||||||||||||
| 342 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||||||||||||||
| 343 | } executed 22 times by 1 test: end of blockExecuted by:
| 22 | ||||||||||||||||||||||||||||||||||||
| 344 | - | |||||||||||||||||||||||||||||||||||||
| 345 | - | |||||||||||||||||||||||||||||||||||||
| 346 | - | |||||||||||||||||||||||||||||||||||||
| 347 | - | |||||||||||||||||||||||||||||||||||||
| 348 | static enum RM_status | - | ||||||||||||||||||||||||||||||||||||
| 349 | excise (FTS *fts, FTSENT *ent, struct rm_options const *x, | - | ||||||||||||||||||||||||||||||||||||
| 350 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 351 | is_dir) | - | ||||||||||||||||||||||||||||||||||||
| 352 | { | - | ||||||||||||||||||||||||||||||||||||
| 353 | int flag = is_dir
| 56476-249811 | ||||||||||||||||||||||||||||||||||||
| 354 | 0x200 | - | ||||||||||||||||||||||||||||||||||||
| 355 | : 0; | - | ||||||||||||||||||||||||||||||||||||
| 356 | if (unlinkat (fts->fts_cwd_fd, ent->fts_accpath, flag) == 0
| 509-305778 | ||||||||||||||||||||||||||||||||||||
| 357 | { | - | ||||||||||||||||||||||||||||||||||||
| 358 | if (x->verbose
| 26-305752 | ||||||||||||||||||||||||||||||||||||
| 359 | { | - | ||||||||||||||||||||||||||||||||||||
| 360 | printf ((is_dir | - | ||||||||||||||||||||||||||||||||||||
| 361 | ? | - | ||||||||||||||||||||||||||||||||||||
| 362 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 363 | "removed directory %s\n" | - | ||||||||||||||||||||||||||||||||||||
| 364 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 365 | - | |||||||||||||||||||||||||||||||||||||
| 366 | : | - | ||||||||||||||||||||||||||||||||||||
| 367 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 368 | "removed %s\n" | - | ||||||||||||||||||||||||||||||||||||
| 369 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 370 | ), quotearg_style (shell_escape_always_quoting_style, ent->fts_path)); | - | ||||||||||||||||||||||||||||||||||||
| 371 | } executed 26 times by 2 tests: end of blockExecuted by:
| 26 | ||||||||||||||||||||||||||||||||||||
| 372 | return executed 305778 times by 2 tests: RM_OK;return RM_OK;Executed by:
executed 305778 times by 2 tests: return RM_OK;Executed by:
| 305778 | ||||||||||||||||||||||||||||||||||||
| 373 | } | - | ||||||||||||||||||||||||||||||||||||
| 374 | - | |||||||||||||||||||||||||||||||||||||
| 375 | - | |||||||||||||||||||||||||||||||||||||
| 376 | - | |||||||||||||||||||||||||||||||||||||
| 377 | - | |||||||||||||||||||||||||||||||||||||
| 378 | - | |||||||||||||||||||||||||||||||||||||
| 379 | if ( | - | ||||||||||||||||||||||||||||||||||||
| 380 | (*
| 0-509 | ||||||||||||||||||||||||||||||||||||
| 381 | ==
| 0-509 | ||||||||||||||||||||||||||||||||||||
| 382 | 30
| 0-509 | ||||||||||||||||||||||||||||||||||||
| 383 | ) | - | ||||||||||||||||||||||||||||||||||||
| 384 | { | - | ||||||||||||||||||||||||||||||||||||
| 385 | struct stat st; | - | ||||||||||||||||||||||||||||||||||||
| 386 | if ( ! (lstatat (fts->fts_cwd_fd, ent->fts_accpath, &st)
| 0 | ||||||||||||||||||||||||||||||||||||
| 387 | && | - | ||||||||||||||||||||||||||||||||||||
| 388 | (*
| 0 | ||||||||||||||||||||||||||||||||||||
| 389 | ==
| 0 | ||||||||||||||||||||||||||||||||||||
| 390 | 2
| 0 | ||||||||||||||||||||||||||||||||||||
| 391 | )) | - | ||||||||||||||||||||||||||||||||||||
| 392 | - | |||||||||||||||||||||||||||||||||||||
| 393 | (* never executed: __errno_location ()) (*__errno_location ()) = 30 ;never executed: (*__errno_location ()) = 30 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 394 | = never executed: (*__errno_location ()) = 30 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 395 | 30 never executed: (*__errno_location ()) = 30 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 396 | ; never executed: (*__errno_location ()) = 30 ; | 0 | ||||||||||||||||||||||||||||||||||||
| 397 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 398 | - | |||||||||||||||||||||||||||||||||||||
| 399 | if (ignorable_missing (x,
| 16-493 | ||||||||||||||||||||||||||||||||||||
| 400 | (*__errno_location ())
| 16-493 | ||||||||||||||||||||||||||||||||||||
| 401 | )
| 16-493 | ||||||||||||||||||||||||||||||||||||
| 402 | return executed 493 times by 1 test: RM_OK;return RM_OK;Executed by:
executed 493 times by 1 test: return RM_OK;Executed by:
| 493 | ||||||||||||||||||||||||||||||||||||
| 403 | - | |||||||||||||||||||||||||||||||||||||
| 404 | - | |||||||||||||||||||||||||||||||||||||
| 405 | - | |||||||||||||||||||||||||||||||||||||
| 406 | - | |||||||||||||||||||||||||||||||||||||
| 407 | - | |||||||||||||||||||||||||||||||||||||
| 408 | - | |||||||||||||||||||||||||||||||||||||
| 409 | if (ent->fts_info == 4
| 3-13 | ||||||||||||||||||||||||||||||||||||
| 410 | && ( | - | ||||||||||||||||||||||||||||||||||||
| 411 | (*
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 412 | ==
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 413 | 39
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 414 | || | - | ||||||||||||||||||||||||||||||||||||
| 415 | (*
| 0 | ||||||||||||||||||||||||||||||||||||
| 416 | ==
| 0 | ||||||||||||||||||||||||||||||||||||
| 417 | 21
| 0 | ||||||||||||||||||||||||||||||||||||
| 418 | || | - | ||||||||||||||||||||||||||||||||||||
| 419 | (*
| 0 | ||||||||||||||||||||||||||||||||||||
| 420 | ==
| 0 | ||||||||||||||||||||||||||||||||||||
| 421 | 20
| 0 | ||||||||||||||||||||||||||||||||||||
| 422 | - | |||||||||||||||||||||||||||||||||||||
| 423 | || | - | ||||||||||||||||||||||||||||||||||||
| 424 | (*
| 0 | ||||||||||||||||||||||||||||||||||||
| 425 | ==
| 0 | ||||||||||||||||||||||||||||||||||||
| 426 | 17
| 0 | ||||||||||||||||||||||||||||||||||||
| 427 | ) | - | ||||||||||||||||||||||||||||||||||||
| 428 | && (ent->fts_errno ==
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 429 | 1
| 0-3 | ||||||||||||||||||||||||||||||||||||
| 430 | || ent->fts_errno ==
| 1-2 | ||||||||||||||||||||||||||||||||||||
| 431 | 13
| 1-2 | ||||||||||||||||||||||||||||||||||||
| 432 | )) | - | ||||||||||||||||||||||||||||||||||||
| 433 | - | |||||||||||||||||||||||||||||||||||||
| 434 | (* executed 2 times by 1 test: __errno_location ()) (*__errno_location ()) = ent->fts_errno;Executed by:
executed 2 times by 1 test: (*__errno_location ()) = ent->fts_errno;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 435 | = ent->fts_errno; executed 2 times by 1 test: (*__errno_location ()) = ent->fts_errno;Executed by:
| 2 | ||||||||||||||||||||||||||||||||||||
| 436 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 437 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 438 | , | - | ||||||||||||||||||||||||||||||||||||
| 439 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 440 | "cannot remove %s" | - | ||||||||||||||||||||||||||||||||||||
| 441 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 442 | , quotearg_style (shell_escape_always_quoting_style, ent->fts_path)); | - | ||||||||||||||||||||||||||||||||||||
| 443 | mark_ancestor_dirs (ent); | - | ||||||||||||||||||||||||||||||||||||
| 444 | return executed 16 times by 1 test: RM_ERROR;return RM_ERROR;Executed by:
executed 16 times by 1 test: return RM_ERROR;Executed by:
| 16 | ||||||||||||||||||||||||||||||||||||
| 445 | } | - | ||||||||||||||||||||||||||||||||||||
| 446 | - | |||||||||||||||||||||||||||||||||||||
| 447 | - | |||||||||||||||||||||||||||||||||||||
| 448 | - | |||||||||||||||||||||||||||||||||||||
| 449 | - | |||||||||||||||||||||||||||||||||||||
| 450 | - | |||||||||||||||||||||||||||||||||||||
| 451 | - | |||||||||||||||||||||||||||||||||||||
| 452 | - | |||||||||||||||||||||||||||||||||||||
| 453 | static enum RM_status | - | ||||||||||||||||||||||||||||||||||||
| 454 | rm_fts (FTS *fts, FTSENT *ent, struct rm_options const *x) | - | ||||||||||||||||||||||||||||||||||||
| 455 | { | - | ||||||||||||||||||||||||||||||||||||
| 456 | switch (ent->fts_info) | - | ||||||||||||||||||||||||||||||||||||
| 457 | { | - | ||||||||||||||||||||||||||||||||||||
| 458 | case executed 56499 times by 2 tests: 1:case 1:Executed by:
executed 56499 times by 2 tests: case 1:Executed by:
| 56499 | ||||||||||||||||||||||||||||||||||||
| 459 | if (! x->recursive
| 7-56492 | ||||||||||||||||||||||||||||||||||||
| 460 | && !(x->remove_empty_directories
| 3-4 | ||||||||||||||||||||||||||||||||||||
| 461 | && is_empty_dir (fts->fts_cwd_fd, ent->fts_accpath)
| 1-2 | ||||||||||||||||||||||||||||||||||||
| 462 | { | - | ||||||||||||||||||||||||||||||||||||
| 463 | - | |||||||||||||||||||||||||||||||||||||
| 464 | - | |||||||||||||||||||||||||||||||||||||
| 465 | - | |||||||||||||||||||||||||||||||||||||
| 466 | - | |||||||||||||||||||||||||||||||||||||
| 467 | int err = x->remove_empty_directories
| 1-4 | ||||||||||||||||||||||||||||||||||||
| 468 | 39 | - | ||||||||||||||||||||||||||||||||||||
| 469 | : | - | ||||||||||||||||||||||||||||||||||||
| 470 | 21 | - | ||||||||||||||||||||||||||||||||||||
| 471 | ; | - | ||||||||||||||||||||||||||||||||||||
| 472 | error (0, err, | - | ||||||||||||||||||||||||||||||||||||
| 473 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 474 | "cannot remove %s" | - | ||||||||||||||||||||||||||||||||||||
| 475 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 476 | , quotearg_style (shell_escape_always_quoting_style, ent->fts_path)); | - | ||||||||||||||||||||||||||||||||||||
| 477 | mark_ancestor_dirs (ent); | - | ||||||||||||||||||||||||||||||||||||
| 478 | fts_skip_tree (fts, ent); | - | ||||||||||||||||||||||||||||||||||||
| 479 | return executed 5 times by 1 test: RM_ERROR;return RM_ERROR;Executed by:
executed 5 times by 1 test: return RM_ERROR;Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||
| 480 | } | - | ||||||||||||||||||||||||||||||||||||
| 481 | - | |||||||||||||||||||||||||||||||||||||
| 482 | - | |||||||||||||||||||||||||||||||||||||
| 483 | if (ent->fts_level == 0
| 4172-52322 | ||||||||||||||||||||||||||||||||||||
| 484 | { | - | ||||||||||||||||||||||||||||||||||||
| 485 | - | |||||||||||||||||||||||||||||||||||||
| 486 | - | |||||||||||||||||||||||||||||||||||||
| 487 | - | |||||||||||||||||||||||||||||||||||||
| 488 | if (dot_or_dotdot (last_component (ent->fts_accpath))
| 5-4167 | ||||||||||||||||||||||||||||||||||||
| 489 | { | - | ||||||||||||||||||||||||||||||||||||
| 490 | error (0, 0, | - | ||||||||||||||||||||||||||||||||||||
| 491 | - | |||||||||||||||||||||||||||||||||||||
| 492 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 493 | "refusing to remove %s or %s directory: skipping %s" | - | ||||||||||||||||||||||||||||||||||||
| 494 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 495 | , | - | ||||||||||||||||||||||||||||||||||||
| 496 | quotearg_n_style (0, shell_escape_always_quoting_style, "."), quotearg_n_style (1, shell_escape_always_quoting_style, ".."), | - | ||||||||||||||||||||||||||||||||||||
| 497 | quotearg_n_style (2, shell_escape_always_quoting_style, ent->fts_path)); | - | ||||||||||||||||||||||||||||||||||||
| 498 | fts_skip_tree (fts, ent); | - | ||||||||||||||||||||||||||||||||||||
| 499 | return executed 5 times by 1 test: RM_ERROR;return RM_ERROR;Executed by:
executed 5 times by 1 test: return RM_ERROR;Executed by:
| 5 | ||||||||||||||||||||||||||||||||||||
| 500 | } | - | ||||||||||||||||||||||||||||||||||||
| 501 | - | |||||||||||||||||||||||||||||||||||||
| 502 | - | |||||||||||||||||||||||||||||||||||||
| 503 | - | |||||||||||||||||||||||||||||||||||||
| 504 | - | |||||||||||||||||||||||||||||||||||||
| 505 | if ((x->root_dev_ino
| 0-4165 | ||||||||||||||||||||||||||||||||||||
| 506 | { | - | ||||||||||||||||||||||||||||||||||||
| 507 | do { if ((
| 0 | ||||||||||||||||||||||||||||||||||||
| 508 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 0 | ||||||||||||||||||||||||||||||||||||
| 509 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 510 | ) && __builtin_constant_p (
| 0 | ||||||||||||||||||||||||||||||||||||
| 511 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 512 | ) && (__s1_len = __builtin_strlen (
| 0 | ||||||||||||||||||||||||||||||||||||
| 513 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 514 | ), __s2_len = __builtin_strlen (
| 0 | ||||||||||||||||||||||||||||||||||||
| 515 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 516 | ), (!((size_t)(const void *)((
| 0 | ||||||||||||||||||||||||||||||||||||
| 517 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 518 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||||||||||||||
| 519 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 520 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 0 | ||||||||||||||||||||||||||||||||||||
| 521 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 522 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||||||||||||||
| 523 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 524 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 0 | ||||||||||||||||||||||||||||||||||||
| 525 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 526 | ,
| 0 | ||||||||||||||||||||||||||||||||||||
| 527 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 528 | ) : (__builtin_constant_p (
| 0 | ||||||||||||||||||||||||||||||||||||
| 529 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 530 | ) && ((size_t)(const void *)((
| 0 | ||||||||||||||||||||||||||||||||||||
| 531 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 532 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||||||||||||||
| 533 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 534 | ) == 1) && (__s1_len = __builtin_strlen (
| 0 | ||||||||||||||||||||||||||||||||||||
| 535 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 536 | ), __s1_len < 4) ? (__builtin_constant_p (
| 0 | ||||||||||||||||||||||||||||||||||||
| 537 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 538 | ) && ((size_t)(const void *)((
| 0 | ||||||||||||||||||||||||||||||||||||
| 539 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 540 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||||||||||||||
| 541 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 542 | ) == 1) ? __builtin_strcmp (
| 0 | ||||||||||||||||||||||||||||||||||||
| 543 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 544 | ,
| 0 | ||||||||||||||||||||||||||||||||||||
| 545 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 546 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 0 | ||||||||||||||||||||||||||||||||||||
| 547 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 548 | ); int __result = (((const unsigned char *) (const char *) (
| 0 | ||||||||||||||||||||||||||||||||||||
| 549 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 550 | ))[0] - __s2[0]); if (__s1_len > 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 551 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 552 | ))[1] - __s2[1]); if (__s1_len > 1
| 0 | ||||||||||||||||||||||||||||||||||||
| 553 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 554 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( ent->fts_path ))[3] - __s2[3]); | 0 | ||||||||||||||||||||||||||||||||||||
| 555 | ent->fts_path
never executed: __result = (((const unsigned char *) (const char *) ( ent->fts_path ))[3] - __s2[3]); | 0 | ||||||||||||||||||||||||||||||||||||
| 556 | ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
| 0 | ||||||||||||||||||||||||||||||||||||
| 557 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 558 | ) && ((size_t)(const void *)((
| 0 | ||||||||||||||||||||||||||||||||||||
| 559 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 560 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||||||||||||||
| 561 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 562 | ) == 1) && (__s2_len = __builtin_strlen (
| 0 | ||||||||||||||||||||||||||||||||||||
| 563 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 564 | ), __s2_len < 4) ? (__builtin_constant_p (
| 0 | ||||||||||||||||||||||||||||||||||||
| 565 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 566 | ) && ((size_t)(const void *)((
| 0 | ||||||||||||||||||||||||||||||||||||
| 567 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 568 | ) + 1) - (size_t)(const void *)(
| 0 | ||||||||||||||||||||||||||||||||||||
| 569 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 570 | ) == 1) ? __builtin_strcmp (
| 0 | ||||||||||||||||||||||||||||||||||||
| 571 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 572 | ,
| 0 | ||||||||||||||||||||||||||||||||||||
| 573 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 574 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 0 | ||||||||||||||||||||||||||||||||||||
| 575 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 576 | ); int __result = (((const unsigned char *) (const char *) (
| 0 | ||||||||||||||||||||||||||||||||||||
| 577 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 578 | ))[0] - __s2[0]); if (__s2_len > 0
| 0 | ||||||||||||||||||||||||||||||||||||
| 579 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 580 | ))[1] - __s2[1]); if (__s2_len > 1
| 0 | ||||||||||||||||||||||||||||||||||||
| 581 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 582 | ))[2] - __s2[2]); if (__s2_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( "/" ))[3] - __s2[3]); | 0 | ||||||||||||||||||||||||||||||||||||
| 583 | "/"
never executed: __result = (((const unsigned char *) (const char *) ( "/" ))[3] - __s2[3]); | 0 | ||||||||||||||||||||||||||||||||||||
| 584 | ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (
| 0 | ||||||||||||||||||||||||||||||||||||
| 585 | ent->fts_path
| 0 | ||||||||||||||||||||||||||||||||||||
| 586 | ,
| 0 | ||||||||||||||||||||||||||||||||||||
| 587 | "/"
| 0 | ||||||||||||||||||||||||||||||||||||
| 588 | )))); })
| 0 | ||||||||||||||||||||||||||||||||||||
| 589 | == 0)
never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, ent->fts_path)); | 0 | ||||||||||||||||||||||||||||||||||||
| 590 | dcgettext (((void *)0), never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, ent->fts_path)); | 0 | ||||||||||||||||||||||||||||||||||||
| 591 | "it is dangerous to operate recursively on %s" never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, ent->fts_path)); | 0 | ||||||||||||||||||||||||||||||||||||
| 592 | , 5) never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, ent->fts_path)); | 0 | ||||||||||||||||||||||||||||||||||||
| 593 | , quotearg_style (shell_escape_always_quoting_style, ent->fts_path)); never executed: else error (0, 0, error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s" , 5) , quotearg_style (shell_escape_always_quoting_style, ent->fts_path));never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, ent->fts_path), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 0 | ||||||||||||||||||||||||||||||||||||
| 594 | dcgettext (((void *)0), never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, ent->fts_path), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 0 | ||||||||||||||||||||||||||||||||||||
| 595 | "it is dangerous to operate recursively on %s (same as %s)" never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, ent->fts_path), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 0 | ||||||||||||||||||||||||||||||||||||
| 596 | , 5) never executed: error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, ent->fts_path), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 0 | ||||||||||||||||||||||||||||||||||||
| 597 | , quotearg_n_style (0, shell_escape_always_quoting_style, ent->fts_path), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); never executed: error (0, 0, error (0, 0, dcgettext (((void *)0), "it is dangerous to operate recursively on %s (same as %s)" , 5) , quotearg_n_style (0, shell_escape_always_quoting_style, ent->fts_path), quotearg_n_style (1, shell_escape_always_quoting_style, "/")); | 0 | ||||||||||||||||||||||||||||||||||||
| 598 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 599 | "use --no-preserve-root to override this failsafe" | - | ||||||||||||||||||||||||||||||||||||
| 600 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 601 | ); } while (0); | - | ||||||||||||||||||||||||||||||||||||
| 602 | fts_skip_tree (fts, ent); | - | ||||||||||||||||||||||||||||||||||||
| 603 | return never executed: RM_ERROR;return RM_ERROR;never executed: return RM_ERROR; | 0 | ||||||||||||||||||||||||||||||||||||
| 604 | } | - | ||||||||||||||||||||||||||||||||||||
| 605 | } executed 4167 times by 2 tests: end of blockExecuted by:
| 4167 | ||||||||||||||||||||||||||||||||||||
| 606 | - | |||||||||||||||||||||||||||||||||||||
| 607 | { | - | ||||||||||||||||||||||||||||||||||||
| 608 | Ternary is_empty_directory; | - | ||||||||||||||||||||||||||||||||||||
| 609 | enum RM_status s = prompt (fts, ent, | - | ||||||||||||||||||||||||||||||||||||
| 610 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 611 | , x, | - | ||||||||||||||||||||||||||||||||||||
| 612 | PA_DESCEND_INTO_DIR, &is_empty_directory); | - | ||||||||||||||||||||||||||||||||||||
| 613 | - | |||||||||||||||||||||||||||||||||||||
| 614 | if (s == RM_OK
| 0-56489 | ||||||||||||||||||||||||||||||||||||
| 615 | { | - | ||||||||||||||||||||||||||||||||||||
| 616 | - | |||||||||||||||||||||||||||||||||||||
| 617 | - | |||||||||||||||||||||||||||||||||||||
| 618 | s = excise (fts, ent, x, | - | ||||||||||||||||||||||||||||||||||||
| 619 | 1 | - | ||||||||||||||||||||||||||||||||||||
| 620 | ); | - | ||||||||||||||||||||||||||||||||||||
| 621 | fts_skip_tree (fts, ent); | - | ||||||||||||||||||||||||||||||||||||
| 622 | } executed 40242 times by 2 tests: end of blockExecuted by:
| 40242 | ||||||||||||||||||||||||||||||||||||
| 623 | - | |||||||||||||||||||||||||||||||||||||
| 624 | if (s != RM_OK
| 1-56488 | ||||||||||||||||||||||||||||||||||||
| 625 | { | - | ||||||||||||||||||||||||||||||||||||
| 626 | mark_ancestor_dirs (ent); | - | ||||||||||||||||||||||||||||||||||||
| 627 | fts_skip_tree (fts, ent); | - | ||||||||||||||||||||||||||||||||||||
| 628 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 629 | - | |||||||||||||||||||||||||||||||||||||
| 630 | return executed 56489 times by 2 tests: s;return s;Executed by:
executed 56489 times by 2 tests: return s;Executed by:
| 56489 | ||||||||||||||||||||||||||||||||||||
| 631 | } | - | ||||||||||||||||||||||||||||||||||||
| 632 | - | |||||||||||||||||||||||||||||||||||||
| 633 | case executed 789 times by 2 tests: 8:case 8:Executed by:
executed 789 times by 2 tests: case 8:Executed by:
| 789 | ||||||||||||||||||||||||||||||||||||
| 634 | case executed 500 times by 1 test: 10:case 10:Executed by:
executed 500 times by 1 test: case 10:Executed by:
| 500 | ||||||||||||||||||||||||||||||||||||
| 635 | case executed 4 times by 2 tests: 12:case 12:Executed by:
executed 4 times by 2 tests: case 12:Executed by:
| 4 | ||||||||||||||||||||||||||||||||||||
| 636 | case never executed: 13:case 13:never executed: case 13: | 0 | ||||||||||||||||||||||||||||||||||||
| 637 | case executed 16239 times by 2 tests: 6:case 6:Executed by:
executed 16239 times by 2 tests: case 6:Executed by:
| 16239 | ||||||||||||||||||||||||||||||||||||
| 638 | case executed 6 times by 1 test: 4:case 4:Executed by:
executed 6 times by 1 test: case 4:Executed by:
| 6 | ||||||||||||||||||||||||||||||||||||
| 639 | case executed 248524 times by 2 tests: 11:case 11:Executed by:
executed 248524 times by 2 tests: case 11:Executed by:
| 248524 | ||||||||||||||||||||||||||||||||||||
| 640 | case executed 1 time by 1 test: 3:case 3:Executed by:
executed 1 time by 1 test: case 3:Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 641 | { | - | ||||||||||||||||||||||||||||||||||||
| 642 | - | |||||||||||||||||||||||||||||||||||||
| 643 | - | |||||||||||||||||||||||||||||||||||||
| 644 | - | |||||||||||||||||||||||||||||||||||||
| 645 | if (ent->fts_info == 6
| 16239-249824 | ||||||||||||||||||||||||||||||||||||
| 646 | && x->one_file_system
| 1-16238 | ||||||||||||||||||||||||||||||||||||
| 647 | && 0 < ent->fts_level
| 0-1 | ||||||||||||||||||||||||||||||||||||
| 648 | && ent->fts_statp->st_dev != fts->fts_dev
| 0 | ||||||||||||||||||||||||||||||||||||
| 649 | { | - | ||||||||||||||||||||||||||||||||||||
| 650 | mark_ancestor_dirs (ent); | - | ||||||||||||||||||||||||||||||||||||
| 651 | error (0, 0, | - | ||||||||||||||||||||||||||||||||||||
| 652 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 653 | "skipping %s, since it's on a different device" | - | ||||||||||||||||||||||||||||||||||||
| 654 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 655 | , | - | ||||||||||||||||||||||||||||||||||||
| 656 | quotearg_style (shell_escape_always_quoting_style, ent->fts_path)); | - | ||||||||||||||||||||||||||||||||||||
| 657 | return never executed: RM_ERROR;return RM_ERROR;never executed: return RM_ERROR; | 0 | ||||||||||||||||||||||||||||||||||||
| 658 | } | - | ||||||||||||||||||||||||||||||||||||
| 659 | - | |||||||||||||||||||||||||||||||||||||
| 660 | - | |||||||||||||||||||||||||||||||||||||
| 661 | _Bool | - | ||||||||||||||||||||||||||||||||||||
| 662 | is_dir = ent->fts_info == 6
| 6-249824 | ||||||||||||||||||||||||||||||||||||
| 663 | enum RM_status s = prompt (fts, ent, is_dir, x, PA_REMOVE_DIR, | - | ||||||||||||||||||||||||||||||||||||
| 664 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 665 | ); | - | ||||||||||||||||||||||||||||||||||||
| 666 | if (s != RM_OK
| 18-266045 | ||||||||||||||||||||||||||||||||||||
| 667 | return executed 18 times by 1 test: s;return s;Executed by:
executed 18 times by 1 test: return s;Executed by:
| 18 | ||||||||||||||||||||||||||||||||||||
| 668 | return executed 266045 times by 2 tests: excise (fts, ent, x, is_dir);return excise (fts, ent, x, is_dir);Executed by:
executed 266045 times by 2 tests: return excise (fts, ent, x, is_dir);Executed by:
| 266045 | ||||||||||||||||||||||||||||||||||||
| 669 | } | - | ||||||||||||||||||||||||||||||||||||
| 670 | - | |||||||||||||||||||||||||||||||||||||
| 671 | case never executed: 2:case 2:never executed: case 2: | 0 | ||||||||||||||||||||||||||||||||||||
| 672 | do { error (0, 0, | - | ||||||||||||||||||||||||||||||||||||
| 673 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 674 | "WARNING: Circular directory structure.\nThis almost certainly means that you have a corrupted file system.\nNOTIFY YOUR SYSTEM MANAGER.\nThe following directory is part of the cycle:\n %s\n" | - | ||||||||||||||||||||||||||||||||||||
| 675 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 676 | , quotearg_n_style_colon (0, shell_escape_quoting_style, ent->fts_path)); } while (0); | - | ||||||||||||||||||||||||||||||||||||
| 677 | fts_skip_tree (fts, ent); | - | ||||||||||||||||||||||||||||||||||||
| 678 | return never executed: RM_ERROR;return RM_ERROR;never executed: return RM_ERROR; | 0 | ||||||||||||||||||||||||||||||||||||
| 679 | - | |||||||||||||||||||||||||||||||||||||
| 680 | case executed 1 time by 1 test: 7:case 7:Executed by:
executed 1 time by 1 test: case 7:Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 681 | - | |||||||||||||||||||||||||||||||||||||
| 682 | - | |||||||||||||||||||||||||||||||||||||
| 683 | error (0, ent->fts_errno, | - | ||||||||||||||||||||||||||||||||||||
| 684 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 685 | "traversal failed: %s" | - | ||||||||||||||||||||||||||||||||||||
| 686 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 687 | , | - | ||||||||||||||||||||||||||||||||||||
| 688 | quotearg_n_style_colon (0, shell_escape_quoting_style, ent->fts_path)); | - | ||||||||||||||||||||||||||||||||||||
| 689 | fts_skip_tree (fts, ent); | - | ||||||||||||||||||||||||||||||||||||
| 690 | return executed 1 time by 1 test: RM_ERROR;return RM_ERROR;Executed by:
executed 1 time by 1 test: return RM_ERROR;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 691 | - | |||||||||||||||||||||||||||||||||||||
| 692 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||||||||
| 693 | error (0, 0, | - | ||||||||||||||||||||||||||||||||||||
| 694 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 695 | "unexpected failure: fts_info=%d: %s\n" "please report to %s" | - | ||||||||||||||||||||||||||||||||||||
| 696 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 697 | - | |||||||||||||||||||||||||||||||||||||
| 698 | , | - | ||||||||||||||||||||||||||||||||||||
| 699 | ent->fts_info, | - | ||||||||||||||||||||||||||||||||||||
| 700 | quotearg_n_style_colon (0, shell_escape_quoting_style, ent->fts_path), | - | ||||||||||||||||||||||||||||||||||||
| 701 | "bug-coreutils@gnu.org"); | - | ||||||||||||||||||||||||||||||||||||
| 702 | abort (); never executed: abort (); | 0 | ||||||||||||||||||||||||||||||||||||
| 703 | } | - | ||||||||||||||||||||||||||||||||||||
| 704 | } | - | ||||||||||||||||||||||||||||||||||||
| 705 | - | |||||||||||||||||||||||||||||||||||||
| 706 | - | |||||||||||||||||||||||||||||||||||||
| 707 | - | |||||||||||||||||||||||||||||||||||||
| 708 | enum RM_status | - | ||||||||||||||||||||||||||||||||||||
| 709 | rm (char *const *file, struct rm_options const *x) | - | ||||||||||||||||||||||||||||||||||||
| 710 | { | - | ||||||||||||||||||||||||||||||||||||
| 711 | enum RM_status rm_status = RM_OK; | - | ||||||||||||||||||||||||||||||||||||
| 712 | - | |||||||||||||||||||||||||||||||||||||
| 713 | if (*
| 0-4403 | ||||||||||||||||||||||||||||||||||||
| 714 | { | - | ||||||||||||||||||||||||||||||||||||
| 715 | int bit_flags = (0x0200 | - | ||||||||||||||||||||||||||||||||||||
| 716 | | 0x0008 | - | ||||||||||||||||||||||||||||||||||||
| 717 | | 0x0010); | - | ||||||||||||||||||||||||||||||||||||
| 718 | - | |||||||||||||||||||||||||||||||||||||
| 719 | if (x->one_file_system
| 1-4402 | ||||||||||||||||||||||||||||||||||||
| 720 | bit_flags |= 0x0040; executed 1 time by 1 test: bit_flags |= 0x0040;Executed by:
| 1 | ||||||||||||||||||||||||||||||||||||
| 721 | - | |||||||||||||||||||||||||||||||||||||
| 722 | FTS *fts = xfts_open (file, bit_flags, | - | ||||||||||||||||||||||||||||||||||||
| 723 | ((void *)0) | - | ||||||||||||||||||||||||||||||||||||
| 724 | ); | - | ||||||||||||||||||||||||||||||||||||
| 725 | - | |||||||||||||||||||||||||||||||||||||
| 726 | while (1) | - | ||||||||||||||||||||||||||||||||||||
| 727 | { | - | ||||||||||||||||||||||||||||||||||||
| 728 | FTSENT *ent; | - | ||||||||||||||||||||||||||||||||||||
| 729 | - | |||||||||||||||||||||||||||||||||||||
| 730 | ent = fts_read (fts); | - | ||||||||||||||||||||||||||||||||||||
| 731 | if (ent ==
| 4403-322563 | ||||||||||||||||||||||||||||||||||||
| 732 | ((void *)0)
| 4403-322563 | ||||||||||||||||||||||||||||||||||||
| 733 | ) | - | ||||||||||||||||||||||||||||||||||||
| 734 | { | - | ||||||||||||||||||||||||||||||||||||
| 735 | if ( | - | ||||||||||||||||||||||||||||||||||||
| 736 | (*
| 0-4403 | ||||||||||||||||||||||||||||||||||||
| 737 | != 0
| 0-4403 | ||||||||||||||||||||||||||||||||||||
| 738 | { | - | ||||||||||||||||||||||||||||||||||||
| 739 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 740 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 741 | , | - | ||||||||||||||||||||||||||||||||||||
| 742 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 743 | "fts_read failed" | - | ||||||||||||||||||||||||||||||||||||
| 744 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 745 | ); | - | ||||||||||||||||||||||||||||||||||||
| 746 | rm_status = RM_ERROR; | - | ||||||||||||||||||||||||||||||||||||
| 747 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 748 | break; executed 4403 times by 2 tests: break;Executed by:
| 4403 | ||||||||||||||||||||||||||||||||||||
| 749 | } | - | ||||||||||||||||||||||||||||||||||||
| 750 | - | |||||||||||||||||||||||||||||||||||||
| 751 | enum RM_status s = rm_fts (fts, ent, x); | - | ||||||||||||||||||||||||||||||||||||
| 752 | - | |||||||||||||||||||||||||||||||||||||
| 753 | - | |||||||||||||||||||||||||||||||||||||
| 754 | (( | - | ||||||||||||||||||||||||||||||||||||
| 755 | ((s) == RM_OK || (s) == RM_USER_DECLINED || (s) == RM_ERROR) | - | ||||||||||||||||||||||||||||||||||||
| 756 | ) ? (void) (0) : __assert_fail ( | - | ||||||||||||||||||||||||||||||||||||
| 757 | "VALID_STATUS (s)" | - | ||||||||||||||||||||||||||||||||||||
| 758 | , "src/remove.c", 574, __PRETTY_FUNCTION__)) | - | ||||||||||||||||||||||||||||||||||||
| 759 | ; | - | ||||||||||||||||||||||||||||||||||||
| 760 | do { if ((
executed 34 times by 1 test: rm_status) = (s);(rm_status) = (s);Executed by:
executed 34 times by 1 test: } while (0);(rm_status) = (s);Executed by:
| 7-322536 | ||||||||||||||||||||||||||||||||||||
| 761 | } executed 322563 times by 2 tests: end of blockExecuted by:
| 322563 | ||||||||||||||||||||||||||||||||||||
| 762 | - | |||||||||||||||||||||||||||||||||||||
| 763 | if (fts_close (fts) != 0
| 0-4403 | ||||||||||||||||||||||||||||||||||||
| 764 | { | - | ||||||||||||||||||||||||||||||||||||
| 765 | error (0, | - | ||||||||||||||||||||||||||||||||||||
| 766 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||||||||
| 767 | , | - | ||||||||||||||||||||||||||||||||||||
| 768 | dcgettext (((void *)0), | - | ||||||||||||||||||||||||||||||||||||
| 769 | "fts_close failed" | - | ||||||||||||||||||||||||||||||||||||
| 770 | , 5) | - | ||||||||||||||||||||||||||||||||||||
| 771 | ); | - | ||||||||||||||||||||||||||||||||||||
| 772 | rm_status = RM_ERROR; | - | ||||||||||||||||||||||||||||||||||||
| 773 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||||||||
| 774 | } executed 4403 times by 2 tests: end of blockExecuted by:
| 4403 | ||||||||||||||||||||||||||||||||||||
| 775 | - | |||||||||||||||||||||||||||||||||||||
| 776 | return executed 4403 times by 2 tests: rm_status;return rm_status;Executed by:
executed 4403 times by 2 tests: return rm_status;Executed by:
| 4403 | ||||||||||||||||||||||||||||||||||||
| 777 | } | - | ||||||||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |