| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/gnulib/lib/fts.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||||||||
| 9 | - | |||||||||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||||||||
| 11 | - | |||||||||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||||||||
| 13 | - | |||||||||||||||||||||||||||||||
| 14 | - | |||||||||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||||||||
| 16 | enum | - | ||||||||||||||||||||||||||||||
| 17 | { | - | ||||||||||||||||||||||||||||||
| 18 | NOT_AN_INODE_NUMBER = 0 | - | ||||||||||||||||||||||||||||||
| 19 | }; | - | ||||||||||||||||||||||||||||||
| 20 | enum | - | ||||||||||||||||||||||||||||||
| 21 | { | - | ||||||||||||||||||||||||||||||
| 22 | _FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD = 10000 | - | ||||||||||||||||||||||||||||||
| 23 | }; | - | ||||||||||||||||||||||||||||||
| 24 | - | |||||||||||||||||||||||||||||||
| 25 | enum Fts_stat | - | ||||||||||||||||||||||||||||||
| 26 | { | - | ||||||||||||||||||||||||||||||
| 27 | FTS_NO_STAT_REQUIRED = 1, | - | ||||||||||||||||||||||||||||||
| 28 | FTS_STAT_REQUIRED = 2 | - | ||||||||||||||||||||||||||||||
| 29 | }; | - | ||||||||||||||||||||||||||||||
| 30 | static FTSENT *fts_alloc (FTS *, const char *, size_t) ; | - | ||||||||||||||||||||||||||||||
| 31 | static FTSENT *fts_build (FTS *, int) ; | - | ||||||||||||||||||||||||||||||
| 32 | static void fts_lfree (FTSENT *) ; | - | ||||||||||||||||||||||||||||||
| 33 | static void fts_load (FTS *, FTSENT *) ; | - | ||||||||||||||||||||||||||||||
| 34 | static size_t fts_maxarglen (char * const *) ; | - | ||||||||||||||||||||||||||||||
| 35 | static void fts_padjust (FTS *, FTSENT *) ; | - | ||||||||||||||||||||||||||||||
| 36 | static | - | ||||||||||||||||||||||||||||||
| 37 | _Bool | - | ||||||||||||||||||||||||||||||
| 38 | fts_palloc (FTS *, size_t) ; | - | ||||||||||||||||||||||||||||||
| 39 | static FTSENT *fts_sort (FTS *, FTSENT *, size_t) ; | - | ||||||||||||||||||||||||||||||
| 40 | static unsigned short int fts_stat (FTS *, FTSENT *, | - | ||||||||||||||||||||||||||||||
| 41 | _Bool | - | ||||||||||||||||||||||||||||||
| 42 | ) ; | - | ||||||||||||||||||||||||||||||
| 43 | static int fts_safe_changedir (FTS *, FTSENT *, int, const char *) | - | ||||||||||||||||||||||||||||||
| 44 | ; | - | ||||||||||||||||||||||||||||||
| 45 | - | |||||||||||||||||||||||||||||||
| 46 | static void | - | ||||||||||||||||||||||||||||||
| 47 | fd_ring_clear (I_ring *fd_ring) | - | ||||||||||||||||||||||||||||||
| 48 | { | - | ||||||||||||||||||||||||||||||
| 49 | while ( ! i_ring_empty (fd_ring)
| 17578-19594 | ||||||||||||||||||||||||||||||
| 50 | { | - | ||||||||||||||||||||||||||||||
| 51 | int fd = i_ring_pop (fd_ring); | - | ||||||||||||||||||||||||||||||
| 52 | if (0 <= fd
| 4845-12733 | ||||||||||||||||||||||||||||||
| 53 | close (fd); executed 4845 times by 6 tests: close (fd);Executed by:
| 4845 | ||||||||||||||||||||||||||||||
| 54 | } executed 17578 times by 6 tests: end of blockExecuted by:
| 17578 | ||||||||||||||||||||||||||||||
| 55 | } executed 19594 times by 6 tests: end of blockExecuted by:
| 19594 | ||||||||||||||||||||||||||||||
| 56 | - | |||||||||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||||||||
| 58 | - | |||||||||||||||||||||||||||||||
| 59 | - | |||||||||||||||||||||||||||||||
| 60 | static void | - | ||||||||||||||||||||||||||||||
| 61 | fts_set_stat_required (FTSENT *p, | - | ||||||||||||||||||||||||||||||
| 62 | _Bool | - | ||||||||||||||||||||||||||||||
| 63 | required) | - | ||||||||||||||||||||||||||||||
| 64 | { | - | ||||||||||||||||||||||||||||||
| 65 | do { if (!(p->fts_info == 11)
never executed: } while (abort (); | 0-801792 | ||||||||||||||||||||||||||||||
| 66 | 0 | - | ||||||||||||||||||||||||||||||
| 67 | ); | - | ||||||||||||||||||||||||||||||
| 68 | p->fts_statp->st_size = (required
| 345372-456420 | ||||||||||||||||||||||||||||||
| 69 | ? FTS_STAT_REQUIRED | - | ||||||||||||||||||||||||||||||
| 70 | : FTS_NO_STAT_REQUIRED); | - | ||||||||||||||||||||||||||||||
| 71 | } executed 801792 times by 6 tests: end of blockExecuted by:
| 801792 | ||||||||||||||||||||||||||||||
| 72 | - | |||||||||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||||||||
| 74 | - | |||||||||||||||||||||||||||||||
| 75 | static DIR * | - | ||||||||||||||||||||||||||||||
| 76 | - | |||||||||||||||||||||||||||||||
| 77 | opendirat (int fd, char const *dir, int extra_flags, int *pdir_fd) | - | ||||||||||||||||||||||||||||||
| 78 | { | - | ||||||||||||||||||||||||||||||
| 79 | int open_flags = ( | - | ||||||||||||||||||||||||||||||
| 80 | 00 | - | ||||||||||||||||||||||||||||||
| 81 | | | - | ||||||||||||||||||||||||||||||
| 82 | 02000000 | - | ||||||||||||||||||||||||||||||
| 83 | | | - | ||||||||||||||||||||||||||||||
| 84 | 0200000 | - | ||||||||||||||||||||||||||||||
| 85 | | | - | ||||||||||||||||||||||||||||||
| 86 | 0400 | - | ||||||||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||||||||
| 88 | | | - | ||||||||||||||||||||||||||||||
| 89 | 04000 | - | ||||||||||||||||||||||||||||||
| 90 | | extra_flags); | - | ||||||||||||||||||||||||||||||
| 91 | int new_fd = openat_safer (fd, dir, open_flags); | - | ||||||||||||||||||||||||||||||
| 92 | DIR *dirp; | - | ||||||||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||||||||
| 94 | if (new_fd < 0
| 7-61084 | ||||||||||||||||||||||||||||||
| 95 | return executed 7 times by 2 tests: return ((void *)0) ;Executed by:
executed 7 times by 2 tests: return ((void *)0) ;Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 96 | ((void *)0) executed 7 times by 2 tests: return ((void *)0) ;Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 97 | ; executed 7 times by 2 tests: return ((void *)0) ;Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 98 | dirp = fdopendir (new_fd); | - | ||||||||||||||||||||||||||||||
| 99 | if (dirp
| 0-61084 | ||||||||||||||||||||||||||||||
| 100 | * executed 61084 times by 6 tests: pdir_fd = new_fd;*pdir_fd = new_fd;Executed by:
executed 61084 times by 6 tests: *pdir_fd = new_fd;Executed by:
| 61084 | ||||||||||||||||||||||||||||||
| 101 | else | - | ||||||||||||||||||||||||||||||
| 102 | { | - | ||||||||||||||||||||||||||||||
| 103 | int saved_errno = | - | ||||||||||||||||||||||||||||||
| 104 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 105 | ; | - | ||||||||||||||||||||||||||||||
| 106 | close (new_fd); | - | ||||||||||||||||||||||||||||||
| 107 | - | |||||||||||||||||||||||||||||||
| 108 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 109 | = saved_errno; | - | ||||||||||||||||||||||||||||||
| 110 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 111 | return executed 61084 times by 6 tests: dirp;return dirp;Executed by:
executed 61084 times by 6 tests: return dirp;Executed by:
| 61084 | ||||||||||||||||||||||||||||||
| 112 | } | - | ||||||||||||||||||||||||||||||
| 113 | - | |||||||||||||||||||||||||||||||
| 114 | - | |||||||||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||||||||
| 116 | - | |||||||||||||||||||||||||||||||
| 117 | - | |||||||||||||||||||||||||||||||
| 118 | - | |||||||||||||||||||||||||||||||
| 119 | static void | - | ||||||||||||||||||||||||||||||
| 120 | - | |||||||||||||||||||||||||||||||
| 121 | cwd_advance_fd (FTS *sp, int fd, | - | ||||||||||||||||||||||||||||||
| 122 | _Bool | - | ||||||||||||||||||||||||||||||
| 123 | chdir_down_one) | - | ||||||||||||||||||||||||||||||
| 124 | { | - | ||||||||||||||||||||||||||||||
| 125 | int old = sp->fts_cwd_fd; | - | ||||||||||||||||||||||||||||||
| 126 | do { if (!(old != fd
| 0-122052 | ||||||||||||||||||||||||||||||
| 127 | -100
| 0-7905 | ||||||||||||||||||||||||||||||
| 128 | )) abort (); never executed: } while (abort (); | 0 | ||||||||||||||||||||||||||||||
| 129 | 0 | - | ||||||||||||||||||||||||||||||
| 130 | ); | - | ||||||||||||||||||||||||||||||
| 131 | - | |||||||||||||||||||||||||||||||
| 132 | if (chdir_down_one
| 56179-73778 | ||||||||||||||||||||||||||||||
| 133 | { | - | ||||||||||||||||||||||||||||||
| 134 | - | |||||||||||||||||||||||||||||||
| 135 | - | |||||||||||||||||||||||||||||||
| 136 | int prev_fd_in_slot = i_ring_push (&sp->fts_fd_ring, old); | - | ||||||||||||||||||||||||||||||
| 137 | ; | - | ||||||||||||||||||||||||||||||
| 138 | if (0 <= prev_fd_in_slot
| 14193-59585 | ||||||||||||||||||||||||||||||
| 139 | close (prev_fd_in_slot); executed 14193 times by 3 tests: close (prev_fd_in_slot);Executed by:
| 14193 | ||||||||||||||||||||||||||||||
| 140 | } executed 73778 times by 6 tests: end of blockExecuted by:
| 73778 | ||||||||||||||||||||||||||||||
| 141 | else if ( ! (sp->fts_options & (0x0004))
| 0-56179 | ||||||||||||||||||||||||||||||
| 142 | { | - | ||||||||||||||||||||||||||||||
| 143 | if (0 <= old
| 0-56179 | ||||||||||||||||||||||||||||||
| 144 | close (old); executed 56179 times by 5 tests: close (old);Executed by:
| 56179 | ||||||||||||||||||||||||||||||
| 145 | } executed 56179 times by 5 tests: end of blockExecuted by:
| 56179 | ||||||||||||||||||||||||||||||
| 146 | - | |||||||||||||||||||||||||||||||
| 147 | sp->fts_cwd_fd = fd; | - | ||||||||||||||||||||||||||||||
| 148 | } executed 129957 times by 6 tests: end of blockExecuted by:
| 129957 | ||||||||||||||||||||||||||||||
| 149 | - | |||||||||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||||||||
| 151 | - | |||||||||||||||||||||||||||||||
| 152 | - | |||||||||||||||||||||||||||||||
| 153 | - | |||||||||||||||||||||||||||||||
| 154 | static int | - | ||||||||||||||||||||||||||||||
| 155 | restore_initial_cwd (FTS *sp) | - | ||||||||||||||||||||||||||||||
| 156 | { | - | ||||||||||||||||||||||||||||||
| 157 | int fail = (!(sp->fts_options & (0x0004))
| 0-12750 | ||||||||||||||||||||||||||||||
| 158 | -100
| 0-12750 | ||||||||||||||||||||||||||||||
| 159 | : sp->fts_rfd),
| 0-12750 | ||||||||||||||||||||||||||||||
| 160 | 1
| 0-12750 | ||||||||||||||||||||||||||||||
| 161 | ), 0) : fchdir ((sp->fts_options & (0x0200)) ?
| 0-12750 | ||||||||||||||||||||||||||||||
| 162 | -100
| 0-12750 | ||||||||||||||||||||||||||||||
| 163 | : sp->fts_rfd))
| 0-12750 | ||||||||||||||||||||||||||||||
| 164 | fd_ring_clear (&(sp->fts_fd_ring)); | - | ||||||||||||||||||||||||||||||
| 165 | return executed 12774 times by 6 tests: fail;return fail;Executed by:
executed 12774 times by 6 tests: return fail;Executed by:
| 12774 | ||||||||||||||||||||||||||||||
| 166 | } | - | ||||||||||||||||||||||||||||||
| 167 | - | |||||||||||||||||||||||||||||||
| 168 | - | |||||||||||||||||||||||||||||||
| 169 | - | |||||||||||||||||||||||||||||||
| 170 | - | |||||||||||||||||||||||||||||||
| 171 | - | |||||||||||||||||||||||||||||||
| 172 | static int | - | ||||||||||||||||||||||||||||||
| 173 | - | |||||||||||||||||||||||||||||||
| 174 | diropen (FTS const *sp, char const *dir) | - | ||||||||||||||||||||||||||||||
| 175 | { | - | ||||||||||||||||||||||||||||||
| 176 | int open_flags = ( | - | ||||||||||||||||||||||||||||||
| 177 | 00 | - | ||||||||||||||||||||||||||||||
| 178 | | | - | ||||||||||||||||||||||||||||||
| 179 | 02000000 | - | ||||||||||||||||||||||||||||||
| 180 | | | - | ||||||||||||||||||||||||||||||
| 181 | 0200000 | - | ||||||||||||||||||||||||||||||
| 182 | | | - | ||||||||||||||||||||||||||||||
| 183 | 0400 | - | ||||||||||||||||||||||||||||||
| 184 | | | - | ||||||||||||||||||||||||||||||
| 185 | 04000 | - | ||||||||||||||||||||||||||||||
| 186 | - | |||||||||||||||||||||||||||||||
| 187 | | ((sp->fts_options & (0x0010)) ? | - | ||||||||||||||||||||||||||||||
| 188 | 0400000 | - | ||||||||||||||||||||||||||||||
| 189 | : 0) | - | ||||||||||||||||||||||||||||||
| 190 | | ((sp->fts_options & (0x0800)) ? | - | ||||||||||||||||||||||||||||||
| 191 | 01000000 | - | ||||||||||||||||||||||||||||||
| 192 | : 0)); | - | ||||||||||||||||||||||||||||||
| 193 | - | |||||||||||||||||||||||||||||||
| 194 | int fd = ((
| 0-14191 | ||||||||||||||||||||||||||||||
| 195 | ? openat_safer (sp->fts_cwd_fd, dir, open_flags) | - | ||||||||||||||||||||||||||||||
| 196 | : open_safer (dir, open_flags)); | - | ||||||||||||||||||||||||||||||
| 197 | return executed 14191 times by 3 tests: fd;return fd;Executed by:
executed 14191 times by 3 tests: return fd;Executed by:
| 14191 | ||||||||||||||||||||||||||||||
| 198 | } | - | ||||||||||||||||||||||||||||||
| 199 | - | |||||||||||||||||||||||||||||||
| 200 | FTS * | - | ||||||||||||||||||||||||||||||
| 201 | fts_open (char * const *argv, | - | ||||||||||||||||||||||||||||||
| 202 | register int options, | - | ||||||||||||||||||||||||||||||
| 203 | int (*compar) (FTSENT const **, FTSENT const **)) | - | ||||||||||||||||||||||||||||||
| 204 | { | - | ||||||||||||||||||||||||||||||
| 205 | register FTS *sp; | - | ||||||||||||||||||||||||||||||
| 206 | register FTSENT *p, *root; | - | ||||||||||||||||||||||||||||||
| 207 | register size_t nitems; | - | ||||||||||||||||||||||||||||||
| 208 | FTSENT *parent = | - | ||||||||||||||||||||||||||||||
| 209 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 210 | ; | - | ||||||||||||||||||||||||||||||
| 211 | FTSENT *tmp = | - | ||||||||||||||||||||||||||||||
| 212 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 213 | ; | - | ||||||||||||||||||||||||||||||
| 214 | - | |||||||||||||||||||||||||||||||
| 215 | _Bool | - | ||||||||||||||||||||||||||||||
| 216 | defer_stat; | - | ||||||||||||||||||||||||||||||
| 217 | - | |||||||||||||||||||||||||||||||
| 218 | - | |||||||||||||||||||||||||||||||
| 219 | if (options & ~0x1fff
| 0-6820 | ||||||||||||||||||||||||||||||
| 220 | - | |||||||||||||||||||||||||||||||
| 221 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 222 | = ( | - | ||||||||||||||||||||||||||||||
| 223 | 22 | - | ||||||||||||||||||||||||||||||
| 224 | ); | - | ||||||||||||||||||||||||||||||
| 225 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 226 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 227 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 228 | } | - | ||||||||||||||||||||||||||||||
| 229 | if ((
| 0-6820 | ||||||||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||||||||
| 231 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 232 | = ( | - | ||||||||||||||||||||||||||||||
| 233 | 22 | - | ||||||||||||||||||||||||||||||
| 234 | ); | - | ||||||||||||||||||||||||||||||
| 235 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 236 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 237 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 238 | } | - | ||||||||||||||||||||||||||||||
| 239 | if ( ! (options & (0x0002 | 0x0010))
| 0-6820 | ||||||||||||||||||||||||||||||
| 240 | - | |||||||||||||||||||||||||||||||
| 241 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 242 | = ( | - | ||||||||||||||||||||||||||||||
| 243 | 22 | - | ||||||||||||||||||||||||||||||
| 244 | ); | - | ||||||||||||||||||||||||||||||
| 245 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 246 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 247 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 248 | } | - | ||||||||||||||||||||||||||||||
| 249 | - | |||||||||||||||||||||||||||||||
| 250 | - | |||||||||||||||||||||||||||||||
| 251 | if ((
| 0-6820 | ||||||||||||||||||||||||||||||
| 252 | ((void *)0)
| 0-6820 | ||||||||||||||||||||||||||||||
| 253 | ) | - | ||||||||||||||||||||||||||||||
| 254 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 255 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 256 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 257 | memset(sp, 0, sizeof(FTS)); | - | ||||||||||||||||||||||||||||||
| 258 | sp->fts_compar = compar; | - | ||||||||||||||||||||||||||||||
| 259 | sp->fts_options = options; | - | ||||||||||||||||||||||||||||||
| 260 | - | |||||||||||||||||||||||||||||||
| 261 | - | |||||||||||||||||||||||||||||||
| 262 | if ((
| 13-6807 | ||||||||||||||||||||||||||||||
| 263 | (sp->fts_options |= (0x0004)); | - | ||||||||||||||||||||||||||||||
| 264 | (sp->fts_options &= ~(0x0200)); | - | ||||||||||||||||||||||||||||||
| 265 | } executed 13 times by 3 tests: end of blockExecuted by:
| 13 | ||||||||||||||||||||||||||||||
| 266 | - | |||||||||||||||||||||||||||||||
| 267 | - | |||||||||||||||||||||||||||||||
| 268 | sp->fts_cwd_fd = | - | ||||||||||||||||||||||||||||||
| 269 | -100 | - | ||||||||||||||||||||||||||||||
| 270 | ; | - | ||||||||||||||||||||||||||||||
| 271 | if ( (
| - | ||||||||||||||||||||||||||||||
| 272 | { dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 273 | - | |||||||||||||||||||||||||||||||
| 274 | - | |||||||||||||||||||||||||||||||
| 275 | - | |||||||||||||||||||||||||||||||
| 276 | - | |||||||||||||||||||||||||||||||
| 277 | int fd = open_safer (".", dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 278 | dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 279 | 00 dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 280 | | ((sp->fts_options & (0x0800)) ? dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 281 | 01000000 dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 282 | : 0)); dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 283 | if (fd < 0) dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 284 | { dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 285 | if ( dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 286 | 0 dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 287 | ) dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 288 | { dead code: { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); }dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 289 | (sp->fts_options |= (0x0004)); dead code: { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); }dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 290 | (sp->fts_options &= ~(0x0200)); dead code: { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); }dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 291 | } dead code: { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); }dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 292 | } dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 293 | else dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 294 | { dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 295 | close (fd); dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 296 | } dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 297 | } dead code: { int fd = open_safer (".", 00 | ((sp->fts_options & (0x0800)) ? 01000000 : 0)); if (fd < 0) { if ( 0 ) { (sp->fts_options |= (0x0004)); (sp->fts_options &= ~(0x0200)); } } else { close (fd); } } | - | ||||||||||||||||||||||||||||||
| 298 | { | - | ||||||||||||||||||||||||||||||
| 299 | size_t maxarglen = fts_maxarglen(argv); | - | ||||||||||||||||||||||||||||||
| 300 | if (! fts_palloc(sp,
| 0-6820 | ||||||||||||||||||||||||||||||
| 301 | (((
| 0-6820 | ||||||||||||||||||||||||||||||
| 302 | maxarglen
| 0-6820 | ||||||||||||||||||||||||||||||
| 303 | )>(4096))?(
| 0-6820 | ||||||||||||||||||||||||||||||
| 304 | maxarglen
| 0-6820 | ||||||||||||||||||||||||||||||
| 305 | ):(4096))
| 0-6820 | ||||||||||||||||||||||||||||||
| 306 | )
| 0-6820 | ||||||||||||||||||||||||||||||
| 307 | goto never executed: mem1;goto mem1;never executed: goto mem1; | 0 | ||||||||||||||||||||||||||||||
| 308 | } | - | ||||||||||||||||||||||||||||||
| 309 | - | |||||||||||||||||||||||||||||||
| 310 | - | |||||||||||||||||||||||||||||||
| 311 | if (*
| 0-6820 | ||||||||||||||||||||||||||||||
| 312 | ((void *)0)
| 0-6820 | ||||||||||||||||||||||||||||||
| 313 | ) { | - | ||||||||||||||||||||||||||||||
| 314 | if ((
| 0-6820 | ||||||||||||||||||||||||||||||
| 315 | ((void *)0)
| 0-6820 | ||||||||||||||||||||||||||||||
| 316 | ) | - | ||||||||||||||||||||||||||||||
| 317 | goto never executed: mem2;goto mem2;never executed: goto mem2; | 0 | ||||||||||||||||||||||||||||||
| 318 | parent->fts_level = (-1); | - | ||||||||||||||||||||||||||||||
| 319 | parent->fts_n_dirs_remaining = -1; | - | ||||||||||||||||||||||||||||||
| 320 | } executed 6820 times by 6 tests: end of blockExecuted by:
| 6820 | ||||||||||||||||||||||||||||||
| 321 | defer_stat = (compar ==
| 0-6820 | ||||||||||||||||||||||||||||||
| 322 | ((void *)0)
| 0-6820 | ||||||||||||||||||||||||||||||
| 323 | || (
| 0 | ||||||||||||||||||||||||||||||
| 324 | - | |||||||||||||||||||||||||||||||
| 325 | - | |||||||||||||||||||||||||||||||
| 326 | for (root = | - | ||||||||||||||||||||||||||||||
| 327 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 328 | , nitems = 0; *
| 6820-7918 | ||||||||||||||||||||||||||||||
| 329 | ((void *)0)
| 6820-7918 | ||||||||||||||||||||||||||||||
| 330 | ; ++argv, ++nitems) { | - | ||||||||||||||||||||||||||||||
| 331 | - | |||||||||||||||||||||||||||||||
| 332 | size_t len = strlen(*argv); | - | ||||||||||||||||||||||||||||||
| 333 | - | |||||||||||||||||||||||||||||||
| 334 | if ( ! (options & 0x1000)
| 0-7918 | ||||||||||||||||||||||||||||||
| 335 | { | - | ||||||||||||||||||||||||||||||
| 336 | - | |||||||||||||||||||||||||||||||
| 337 | - | |||||||||||||||||||||||||||||||
| 338 | char const *v = *argv; | - | ||||||||||||||||||||||||||||||
| 339 | if (2 < len
| 7-4621 | ||||||||||||||||||||||||||||||
| 340 | while (1 < len
| 0-12 | ||||||||||||||||||||||||||||||
| 341 | -- executed 5 times by 1 test: len;--len;Executed by:
executed 5 times by 1 test: --len;Executed by:
| 5 | ||||||||||||||||||||||||||||||
| 342 | } executed 7918 times by 6 tests: end of blockExecuted by:
| 7918 | ||||||||||||||||||||||||||||||
| 343 | - | |||||||||||||||||||||||||||||||
| 344 | if ((
| 0-7918 | ||||||||||||||||||||||||||||||
| 345 | ((void *)0)
| 0-7918 | ||||||||||||||||||||||||||||||
| 346 | ) | - | ||||||||||||||||||||||||||||||
| 347 | goto never executed: mem3;goto mem3;never executed: goto mem3; | 0 | ||||||||||||||||||||||||||||||
| 348 | p->fts_level = 0; | - | ||||||||||||||||||||||||||||||
| 349 | p->fts_parent = parent; | - | ||||||||||||||||||||||||||||||
| 350 | p->fts_accpath = p->fts_name; | - | ||||||||||||||||||||||||||||||
| 351 | - | |||||||||||||||||||||||||||||||
| 352 | - | |||||||||||||||||||||||||||||||
| 353 | - | |||||||||||||||||||||||||||||||
| 354 | if (defer_stat
| 0-7918 | ||||||||||||||||||||||||||||||
| 355 | ((void *)0)
| 1098-6820 | ||||||||||||||||||||||||||||||
| 356 | ) { | - | ||||||||||||||||||||||||||||||
| 357 | p->fts_info = 11; | - | ||||||||||||||||||||||||||||||
| 358 | fts_set_stat_required(p, | - | ||||||||||||||||||||||||||||||
| 359 | 1 | - | ||||||||||||||||||||||||||||||
| 360 | ); | - | ||||||||||||||||||||||||||||||
| 361 | } executed 1098 times by 3 tests: else {end of blockExecuted by:
| 1098 | ||||||||||||||||||||||||||||||
| 362 | p->fts_info = fts_stat(sp, p, | - | ||||||||||||||||||||||||||||||
| 363 | 0 | - | ||||||||||||||||||||||||||||||
| 364 | ); | - | ||||||||||||||||||||||||||||||
| 365 | } executed 6820 times by 6 tests: end of blockExecuted by:
| 6820 | ||||||||||||||||||||||||||||||
| 366 | - | |||||||||||||||||||||||||||||||
| 367 | - | |||||||||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||||||||
| 369 | - | |||||||||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||||||||
| 371 | if (compar
| 0-7918 | ||||||||||||||||||||||||||||||
| 372 | p->fts_link = root; | - | ||||||||||||||||||||||||||||||
| 373 | root = p; | - | ||||||||||||||||||||||||||||||
| 374 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||||||||
| 375 | p->fts_link = | - | ||||||||||||||||||||||||||||||
| 376 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 377 | ; | - | ||||||||||||||||||||||||||||||
| 378 | if (root ==
| 1098-6820 | ||||||||||||||||||||||||||||||
| 379 | ((void *)0)
| 1098-6820 | ||||||||||||||||||||||||||||||
| 380 | ) | - | ||||||||||||||||||||||||||||||
| 381 | tmp = root = p; executed 6820 times by 6 tests: tmp = root = p;Executed by:
| 6820 | ||||||||||||||||||||||||||||||
| 382 | else { | - | ||||||||||||||||||||||||||||||
| 383 | tmp->fts_link = p; | - | ||||||||||||||||||||||||||||||
| 384 | tmp = p; | - | ||||||||||||||||||||||||||||||
| 385 | } executed 1098 times by 3 tests: end of blockExecuted by:
| 1098 | ||||||||||||||||||||||||||||||
| 386 | } | - | ||||||||||||||||||||||||||||||
| 387 | } | - | ||||||||||||||||||||||||||||||
| 388 | if (compar
| 0-6820 | ||||||||||||||||||||||||||||||
| 389 | root = fts_sort(sp, root, nitems); never executed: root = fts_sort(sp, root, nitems); | 0 | ||||||||||||||||||||||||||||||
| 390 | - | |||||||||||||||||||||||||||||||
| 391 | - | |||||||||||||||||||||||||||||||
| 392 | - | |||||||||||||||||||||||||||||||
| 393 | - | |||||||||||||||||||||||||||||||
| 394 | - | |||||||||||||||||||||||||||||||
| 395 | - | |||||||||||||||||||||||||||||||
| 396 | if ((
| 0-6820 | ||||||||||||||||||||||||||||||
| 397 | ((void *)0)
| 0-6820 | ||||||||||||||||||||||||||||||
| 398 | ) | - | ||||||||||||||||||||||||||||||
| 399 | goto never executed: mem3;goto mem3;never executed: goto mem3; | 0 | ||||||||||||||||||||||||||||||
| 400 | sp->fts_cur->fts_link = root; | - | ||||||||||||||||||||||||||||||
| 401 | sp->fts_cur->fts_info = 9; | - | ||||||||||||||||||||||||||||||
| 402 | if (! setup_dir (sp)
| 0-6820 | ||||||||||||||||||||||||||||||
| 403 | goto never executed: mem3;goto mem3;never executed: goto mem3; | 0 | ||||||||||||||||||||||||||||||
| 404 | if (!(sp->fts_options & (0x0004))
| 0-6807 | ||||||||||||||||||||||||||||||
| 405 | && (
| 0 | ||||||||||||||||||||||||||||||
| 406 | ( never executed: sp->fts_options |= (0x0004));(sp->fts_options |= (0x0004));never executed: (sp->fts_options |= (0x0004)); | 0 | ||||||||||||||||||||||||||||||
| 407 | - | |||||||||||||||||||||||||||||||
| 408 | i_ring_init (&sp->fts_fd_ring, -1); | - | ||||||||||||||||||||||||||||||
| 409 | return executed 6820 times by 6 tests: (sp);return (sp);Executed by:
executed 6820 times by 6 tests: return (sp);Executed by:
| 6820 | ||||||||||||||||||||||||||||||
| 410 | - | |||||||||||||||||||||||||||||||
| 411 | mem3: fts_lfree(root); | - | ||||||||||||||||||||||||||||||
| 412 | free(parent); | - | ||||||||||||||||||||||||||||||
| 413 | mem2: code before this statement never executed: free(sp->fts_path);mem2: | 0 | ||||||||||||||||||||||||||||||
| 414 | mem1: code before this statement never executed: free(sp);mem1: | 0 | ||||||||||||||||||||||||||||||
| 415 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 416 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 417 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 418 | } | - | ||||||||||||||||||||||||||||||
| 419 | - | |||||||||||||||||||||||||||||||
| 420 | static void | - | ||||||||||||||||||||||||||||||
| 421 | - | |||||||||||||||||||||||||||||||
| 422 | fts_load (FTS *sp, register FTSENT *p) | - | ||||||||||||||||||||||||||||||
| 423 | { | - | ||||||||||||||||||||||||||||||
| 424 | register size_t len; | - | ||||||||||||||||||||||||||||||
| 425 | register char *cp; | - | ||||||||||||||||||||||||||||||
| 426 | len = p->fts_pathlen = p->fts_namelen; | - | ||||||||||||||||||||||||||||||
| 427 | memmove(sp->fts_path, p->fts_name, len + 1); | - | ||||||||||||||||||||||||||||||
| 428 | if ((
| 0-7197 | ||||||||||||||||||||||||||||||
| 429 | len = strlen(++cp); | - | ||||||||||||||||||||||||||||||
| 430 | memmove(p->fts_name, cp, len + 1); | - | ||||||||||||||||||||||||||||||
| 431 | p->fts_namelen = len; | - | ||||||||||||||||||||||||||||||
| 432 | } executed 717 times by 5 tests: end of blockExecuted by:
| 717 | ||||||||||||||||||||||||||||||
| 433 | p->fts_accpath = p->fts_path = sp->fts_path; | - | ||||||||||||||||||||||||||||||
| 434 | } executed 7918 times by 6 tests: end of blockExecuted by:
| 7918 | ||||||||||||||||||||||||||||||
| 435 | - | |||||||||||||||||||||||||||||||
| 436 | int | - | ||||||||||||||||||||||||||||||
| 437 | fts_close (FTS *sp) | - | ||||||||||||||||||||||||||||||
| 438 | { | - | ||||||||||||||||||||||||||||||
| 439 | register FTSENT *freep, *p; | - | ||||||||||||||||||||||||||||||
| 440 | int saved_errno = 0; | - | ||||||||||||||||||||||||||||||
| 441 | - | |||||||||||||||||||||||||||||||
| 442 | - | |||||||||||||||||||||||||||||||
| 443 | - | |||||||||||||||||||||||||||||||
| 444 | - | |||||||||||||||||||||||||||||||
| 445 | - | |||||||||||||||||||||||||||||||
| 446 | - | |||||||||||||||||||||||||||||||
| 447 | if (sp->fts_cur
| 1-6819 | ||||||||||||||||||||||||||||||
| 448 | for (p = sp->fts_cur; p->fts_level >= 0
| 1-4 | ||||||||||||||||||||||||||||||
| 449 | freep = p; | - | ||||||||||||||||||||||||||||||
| 450 | p = p->fts_link !=
| 0-4 | ||||||||||||||||||||||||||||||
| 451 | ((void *)0)
| 0-4 | ||||||||||||||||||||||||||||||
| 452 | ? p->fts_link : p->fts_parent; | - | ||||||||||||||||||||||||||||||
| 453 | free(freep); | - | ||||||||||||||||||||||||||||||
| 454 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||||||||
| 455 | free(p); | - | ||||||||||||||||||||||||||||||
| 456 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||
| 457 | - | |||||||||||||||||||||||||||||||
| 458 | - | |||||||||||||||||||||||||||||||
| 459 | if (sp->fts_child
| 0-6820 | ||||||||||||||||||||||||||||||
| 460 | fts_lfree(sp->fts_child); never executed: fts_lfree(sp->fts_child); | 0 | ||||||||||||||||||||||||||||||
| 461 | free(sp->fts_array); | - | ||||||||||||||||||||||||||||||
| 462 | free(sp->fts_path); | - | ||||||||||||||||||||||||||||||
| 463 | - | |||||||||||||||||||||||||||||||
| 464 | if ((
| 13-6807 | ||||||||||||||||||||||||||||||
| 465 | { | - | ||||||||||||||||||||||||||||||
| 466 | if (0 <= sp->fts_cwd_fd
| 1-6806 | ||||||||||||||||||||||||||||||
| 467 | if (close (sp->fts_cwd_fd)
| 0-1 | ||||||||||||||||||||||||||||||
| 468 | saved_errno = never executed: saved_errno = (*__errno_location ()) ; | 0 | ||||||||||||||||||||||||||||||
| 469 | (*__errno_location ()) never executed: saved_errno = (*__errno_location ()) ; | 0 | ||||||||||||||||||||||||||||||
| 470 | ; never executed: saved_errno = (*__errno_location ()) ; | 0 | ||||||||||||||||||||||||||||||
| 471 | } executed 6807 times by 6 tests: end of blockExecuted by:
| 6807 | ||||||||||||||||||||||||||||||
| 472 | else if (!(sp->fts_options & (0x0004))
| 0-13 | ||||||||||||||||||||||||||||||
| 473 | { | - | ||||||||||||||||||||||||||||||
| 474 | - | |||||||||||||||||||||||||||||||
| 475 | if (fchdir(sp->fts_rfd)
| 0 | ||||||||||||||||||||||||||||||
| 476 | saved_errno = never executed: saved_errno = (*__errno_location ()) ; | 0 | ||||||||||||||||||||||||||||||
| 477 | (*__errno_location ()) never executed: saved_errno = (*__errno_location ()) ; | 0 | ||||||||||||||||||||||||||||||
| 478 | ; never executed: saved_errno = (*__errno_location ()) ; | 0 | ||||||||||||||||||||||||||||||
| 479 | - | |||||||||||||||||||||||||||||||
| 480 | - | |||||||||||||||||||||||||||||||
| 481 | - | |||||||||||||||||||||||||||||||
| 482 | if (close (sp->fts_rfd)
| 0 | ||||||||||||||||||||||||||||||
| 483 | if (saved_errno == 0
| 0 | ||||||||||||||||||||||||||||||
| 484 | saved_errno = never executed: saved_errno = (*__errno_location ()) ; | 0 | ||||||||||||||||||||||||||||||
| 485 | (*__errno_location ()) never executed: saved_errno = (*__errno_location ()) ; | 0 | ||||||||||||||||||||||||||||||
| 486 | ; never executed: saved_errno = (*__errno_location ()) ; | 0 | ||||||||||||||||||||||||||||||
| 487 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 488 | - | |||||||||||||||||||||||||||||||
| 489 | fd_ring_clear (&sp->fts_fd_ring); | - | ||||||||||||||||||||||||||||||
| 490 | - | |||||||||||||||||||||||||||||||
| 491 | if (sp->fts_leaf_optimization_works_ht
| 2586-4234 | ||||||||||||||||||||||||||||||
| 492 | hash_free (sp->fts_leaf_optimization_works_ht); executed 4234 times by 6 tests: hash_free (sp->fts_leaf_optimization_works_ht);Executed by:
| 4234 | ||||||||||||||||||||||||||||||
| 493 | - | |||||||||||||||||||||||||||||||
| 494 | free_dir (sp); | - | ||||||||||||||||||||||||||||||
| 495 | - | |||||||||||||||||||||||||||||||
| 496 | - | |||||||||||||||||||||||||||||||
| 497 | free(sp); | - | ||||||||||||||||||||||||||||||
| 498 | - | |||||||||||||||||||||||||||||||
| 499 | - | |||||||||||||||||||||||||||||||
| 500 | if (saved_errno
| 0-6820 | ||||||||||||||||||||||||||||||
| 501 | - | |||||||||||||||||||||||||||||||
| 502 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 503 | = (saved_errno); | - | ||||||||||||||||||||||||||||||
| 504 | return never executed: (-1);return (-1);never executed: return (-1); | 0 | ||||||||||||||||||||||||||||||
| 505 | } | - | ||||||||||||||||||||||||||||||
| 506 | - | |||||||||||||||||||||||||||||||
| 507 | return executed 6820 times by 6 tests: (0);return (0);Executed by:
executed 6820 times by 6 tests: return (0);Executed by:
| 6820 | ||||||||||||||||||||||||||||||
| 508 | } | - | ||||||||||||||||||||||||||||||
| 509 | - | |||||||||||||||||||||||||||||||
| 510 | - | |||||||||||||||||||||||||||||||
| 511 | - | |||||||||||||||||||||||||||||||
| 512 | - | |||||||||||||||||||||||||||||||
| 513 | - | |||||||||||||||||||||||||||||||
| 514 | enum { MIN_DIR_NLINK = 2 }; | - | ||||||||||||||||||||||||||||||
| 515 | - | |||||||||||||||||||||||||||||||
| 516 | - | |||||||||||||||||||||||||||||||
| 517 | enum leaf_optimization | - | ||||||||||||||||||||||||||||||
| 518 | { | - | ||||||||||||||||||||||||||||||
| 519 | - | |||||||||||||||||||||||||||||||
| 520 | NO_LEAF_OPTIMIZATION, | - | ||||||||||||||||||||||||||||||
| 521 | - | |||||||||||||||||||||||||||||||
| 522 | - | |||||||||||||||||||||||||||||||
| 523 | OK_LEAF_OPTIMIZATION, | - | ||||||||||||||||||||||||||||||
| 524 | - | |||||||||||||||||||||||||||||||
| 525 | - | |||||||||||||||||||||||||||||||
| 526 | - | |||||||||||||||||||||||||||||||
| 527 | NOSTAT_LEAF_OPTIMIZATION | - | ||||||||||||||||||||||||||||||
| 528 | }; | - | ||||||||||||||||||||||||||||||
| 529 | - | |||||||||||||||||||||||||||||||
| 530 | - | |||||||||||||||||||||||||||||||
| 531 | - | |||||||||||||||||||||||||||||||
| 532 | - | |||||||||||||||||||||||||||||||
| 533 | - | |||||||||||||||||||||||||||||||
| 534 | typedef __fsword_t fsword; | - | ||||||||||||||||||||||||||||||
| 535 | - | |||||||||||||||||||||||||||||||
| 536 | - | |||||||||||||||||||||||||||||||
| 537 | - | |||||||||||||||||||||||||||||||
| 538 | - | |||||||||||||||||||||||||||||||
| 539 | - | |||||||||||||||||||||||||||||||
| 540 | struct dev_type | - | ||||||||||||||||||||||||||||||
| 541 | { | - | ||||||||||||||||||||||||||||||
| 542 | dev_t st_dev; | - | ||||||||||||||||||||||||||||||
| 543 | fsword f_type; | - | ||||||||||||||||||||||||||||||
| 544 | }; | - | ||||||||||||||||||||||||||||||
| 545 | - | |||||||||||||||||||||||||||||||
| 546 | - | |||||||||||||||||||||||||||||||
| 547 | - | |||||||||||||||||||||||||||||||
| 548 | - | |||||||||||||||||||||||||||||||
| 549 | enum { DEV_TYPE_HT_INITIAL_SIZE = 13 }; | - | ||||||||||||||||||||||||||||||
| 550 | - | |||||||||||||||||||||||||||||||
| 551 | static size_t | - | ||||||||||||||||||||||||||||||
| 552 | dev_type_hash (void const *x, size_t table_size) | - | ||||||||||||||||||||||||||||||
| 553 | { | - | ||||||||||||||||||||||||||||||
| 554 | struct dev_type const *ax = x; | - | ||||||||||||||||||||||||||||||
| 555 | uintmax_t dev = ax->st_dev; | - | ||||||||||||||||||||||||||||||
| 556 | return executed 4707 times by 6 tests: dev % table_size;return dev % table_size;Executed by:
executed 4707 times by 6 tests: return dev % table_size;Executed by:
| 4707 | ||||||||||||||||||||||||||||||
| 557 | } | - | ||||||||||||||||||||||||||||||
| 558 | - | |||||||||||||||||||||||||||||||
| 559 | static | - | ||||||||||||||||||||||||||||||
| 560 | _Bool | - | ||||||||||||||||||||||||||||||
| 561 | - | |||||||||||||||||||||||||||||||
| 562 | dev_type_compare (void const *x, void const *y) | - | ||||||||||||||||||||||||||||||
| 563 | { | - | ||||||||||||||||||||||||||||||
| 564 | struct dev_type const *ax = x; | - | ||||||||||||||||||||||||||||||
| 565 | struct dev_type const *ay = y; | - | ||||||||||||||||||||||||||||||
| 566 | return executed 242 times by 4 tests: ax->st_dev == ay->st_dev;return ax->st_dev == ay->st_dev;Executed by:
executed 242 times by 4 tests: return ax->st_dev == ay->st_dev;Executed by:
| 242 | ||||||||||||||||||||||||||||||
| 567 | } | - | ||||||||||||||||||||||||||||||
| 568 | - | |||||||||||||||||||||||||||||||
| 569 | - | |||||||||||||||||||||||||||||||
| 570 | - | |||||||||||||||||||||||||||||||
| 571 | - | |||||||||||||||||||||||||||||||
| 572 | static fsword | - | ||||||||||||||||||||||||||||||
| 573 | filesystem_type (FTSENT const *p) | - | ||||||||||||||||||||||||||||||
| 574 | { | - | ||||||||||||||||||||||||||||||
| 575 | FTS *sp = p->fts_fts; | - | ||||||||||||||||||||||||||||||
| 576 | Hash_table *h = sp->fts_leaf_optimization_works_ht; | - | ||||||||||||||||||||||||||||||
| 577 | struct dev_type *ent; | - | ||||||||||||||||||||||||||||||
| 578 | struct statfs fs_buf; | - | ||||||||||||||||||||||||||||||
| 579 | - | |||||||||||||||||||||||||||||||
| 580 | - | |||||||||||||||||||||||||||||||
| 581 | - | |||||||||||||||||||||||||||||||
| 582 | if (!(sp->fts_options & (0x0200))
| 0-4481 | ||||||||||||||||||||||||||||||
| 583 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||||||||
| 584 | - | |||||||||||||||||||||||||||||||
| 585 | if (! h
| 247-4234 | ||||||||||||||||||||||||||||||
| 586 | h = sp->fts_leaf_optimization_works_ht executed 4234 times by 6 tests: h = sp->fts_leaf_optimization_works_ht = hash_initialize (DEV_TYPE_HT_INITIAL_SIZE, ((void *)0) , dev_type_hash, dev_type_compare, free);Executed by:
| 4234 | ||||||||||||||||||||||||||||||
| 587 | = hash_initialize (DEV_TYPE_HT_INITIAL_SIZE, executed 4234 times by 6 tests: h = sp->fts_leaf_optimization_works_ht = hash_initialize (DEV_TYPE_HT_INITIAL_SIZE, ((void *)0) , dev_type_hash, dev_type_compare, free);Executed by:
| 4234 | ||||||||||||||||||||||||||||||
| 588 | ((void *)0) executed 4234 times by 6 tests: h = sp->fts_leaf_optimization_works_ht = hash_initialize (DEV_TYPE_HT_INITIAL_SIZE, ((void *)0) , dev_type_hash, dev_type_compare, free);Executed by:
| 4234 | ||||||||||||||||||||||||||||||
| 589 | , dev_type_hash, executed 4234 times by 6 tests: h = sp->fts_leaf_optimization_works_ht = hash_initialize (DEV_TYPE_HT_INITIAL_SIZE, ((void *)0) , dev_type_hash, dev_type_compare, free);Executed by:
| 4234 | ||||||||||||||||||||||||||||||
| 590 | dev_type_compare, free); executed 4234 times by 6 tests: h = sp->fts_leaf_optimization_works_ht = hash_initialize (DEV_TYPE_HT_INITIAL_SIZE, ((void *)0) , dev_type_hash, dev_type_compare, free);Executed by:
| 4234 | ||||||||||||||||||||||||||||||
| 591 | if (h
| 0-4481 | ||||||||||||||||||||||||||||||
| 592 | { | - | ||||||||||||||||||||||||||||||
| 593 | struct dev_type tmp; | - | ||||||||||||||||||||||||||||||
| 594 | tmp.st_dev = p->fts_statp->st_dev; | - | ||||||||||||||||||||||||||||||
| 595 | ent = hash_lookup (h, &tmp); | - | ||||||||||||||||||||||||||||||
| 596 | if (ent
| 242-4239 | ||||||||||||||||||||||||||||||
| 597 | return executed 242 times by 4 tests: ent->f_type;return ent->f_type;Executed by:
executed 242 times by 4 tests: return ent->f_type;Executed by:
| 242 | ||||||||||||||||||||||||||||||
| 598 | } executed 4239 times by 6 tests: end of blockExecuted by:
| 4239 | ||||||||||||||||||||||||||||||
| 599 | - | |||||||||||||||||||||||||||||||
| 600 | - | |||||||||||||||||||||||||||||||
| 601 | if (fstatfs (p->fts_fts->fts_cwd_fd, &fs_buf) != 0
| 226-4013 | ||||||||||||||||||||||||||||||
| 602 | return executed 4013 times by 5 tests: 0;return 0;Executed by:
executed 4013 times by 5 tests: return 0;Executed by:
| 4013 | ||||||||||||||||||||||||||||||
| 603 | - | |||||||||||||||||||||||||||||||
| 604 | if (h
| 0-226 | ||||||||||||||||||||||||||||||
| 605 | { | - | ||||||||||||||||||||||||||||||
| 606 | struct dev_type *t2 = malloc (sizeof *t2); | - | ||||||||||||||||||||||||||||||
| 607 | if (t2
| 0-226 | ||||||||||||||||||||||||||||||
| 608 | { | - | ||||||||||||||||||||||||||||||
| 609 | t2->st_dev = p->fts_statp->st_dev; | - | ||||||||||||||||||||||||||||||
| 610 | t2->f_type = fs_buf.f_type; | - | ||||||||||||||||||||||||||||||
| 611 | - | |||||||||||||||||||||||||||||||
| 612 | ent = hash_insert (h, t2); | - | ||||||||||||||||||||||||||||||
| 613 | if (ent
| 0-226 | ||||||||||||||||||||||||||||||
| 614 | do { if (!(ent == t2)
never executed: }abort ();executed 226 times by 4 tests: while (end of blockExecuted by:
| 0-226 | ||||||||||||||||||||||||||||||
| 615 | 0 | - | ||||||||||||||||||||||||||||||
| 616 | ); | - | ||||||||||||||||||||||||||||||
| 617 | else | - | ||||||||||||||||||||||||||||||
| 618 | free (t2); never executed: free (t2); | 0 | ||||||||||||||||||||||||||||||
| 619 | } | - | ||||||||||||||||||||||||||||||
| 620 | } executed 226 times by 4 tests: end of blockExecuted by:
| 226 | ||||||||||||||||||||||||||||||
| 621 | - | |||||||||||||||||||||||||||||||
| 622 | return executed 226 times by 4 tests: fs_buf.f_type;return fs_buf.f_type;Executed by:
executed 226 times by 4 tests: return fs_buf.f_type;Executed by:
| 226 | ||||||||||||||||||||||||||||||
| 623 | } | - | ||||||||||||||||||||||||||||||
| 624 | - | |||||||||||||||||||||||||||||||
| 625 | - | |||||||||||||||||||||||||||||||
| 626 | - | |||||||||||||||||||||||||||||||
| 627 | - | |||||||||||||||||||||||||||||||
| 628 | - | |||||||||||||||||||||||||||||||
| 629 | static | - | ||||||||||||||||||||||||||||||
| 630 | _Bool | - | ||||||||||||||||||||||||||||||
| 631 | - | |||||||||||||||||||||||||||||||
| 632 | dirent_inode_sort_may_be_useful (FTSENT const *p) | - | ||||||||||||||||||||||||||||||
| 633 | { | - | ||||||||||||||||||||||||||||||
| 634 | - | |||||||||||||||||||||||||||||||
| 635 | - | |||||||||||||||||||||||||||||||
| 636 | - | |||||||||||||||||||||||||||||||
| 637 | - | |||||||||||||||||||||||||||||||
| 638 | - | |||||||||||||||||||||||||||||||
| 639 | - | |||||||||||||||||||||||||||||||
| 640 | switch (filesystem_type (p)) | - | ||||||||||||||||||||||||||||||
| 641 | { | - | ||||||||||||||||||||||||||||||
| 642 | case never executed: 0x1021994:case 0x1021994:never executed: case 0x1021994: | 0 | ||||||||||||||||||||||||||||||
| 643 | case never executed: 0x6969:case 0x6969:never executed: case 0x6969: | 0 | ||||||||||||||||||||||||||||||
| 644 | - | |||||||||||||||||||||||||||||||
| 645 | - | |||||||||||||||||||||||||||||||
| 646 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||
| 647 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||
| 648 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||
| 649 | - | |||||||||||||||||||||||||||||||
| 650 | default executed 14 times by 3 tests: :default:Executed by:
executed 14 times by 3 tests: default:Executed by:
| 14 | ||||||||||||||||||||||||||||||
| 651 | return executed 14 times by 3 tests: return 1 ;Executed by:
executed 14 times by 3 tests: return 1 ;Executed by:
| 14 | ||||||||||||||||||||||||||||||
| 652 | 1 executed 14 times by 3 tests: return 1 ;Executed by:
| 14 | ||||||||||||||||||||||||||||||
| 653 | ; executed 14 times by 3 tests: return 1 ;Executed by:
| 14 | ||||||||||||||||||||||||||||||
| 654 | } | - | ||||||||||||||||||||||||||||||
| 655 | } | - | ||||||||||||||||||||||||||||||
| 656 | - | |||||||||||||||||||||||||||||||
| 657 | - | |||||||||||||||||||||||||||||||
| 658 | - | |||||||||||||||||||||||||||||||
| 659 | - | |||||||||||||||||||||||||||||||
| 660 | - | |||||||||||||||||||||||||||||||
| 661 | - | |||||||||||||||||||||||||||||||
| 662 | - | |||||||||||||||||||||||||||||||
| 663 | static enum leaf_optimization | - | ||||||||||||||||||||||||||||||
| 664 | leaf_optimization (FTSENT const *p) | - | ||||||||||||||||||||||||||||||
| 665 | { | - | ||||||||||||||||||||||||||||||
| 666 | switch (filesystem_type (p)) | - | ||||||||||||||||||||||||||||||
| 667 | { | - | ||||||||||||||||||||||||||||||
| 668 | - | |||||||||||||||||||||||||||||||
| 669 | - | |||||||||||||||||||||||||||||||
| 670 | case never executed: 0x52654973:case 0x52654973:never executed: case 0x52654973: | 0 | ||||||||||||||||||||||||||||||
| 671 | case never executed: 0x58465342:case 0x58465342:never executed: case 0x58465342: | 0 | ||||||||||||||||||||||||||||||
| 672 | return never executed: NOSTAT_LEAF_OPTIMIZATION;return NOSTAT_LEAF_OPTIMIZATION;never executed: return NOSTAT_LEAF_OPTIMIZATION; | 0 | ||||||||||||||||||||||||||||||
| 673 | - | |||||||||||||||||||||||||||||||
| 674 | case executed 4013 times by 5 tests: 0:case 0:Executed by:
executed 4013 times by 5 tests: case 0:Executed by:
| 4013 | ||||||||||||||||||||||||||||||
| 675 | - | |||||||||||||||||||||||||||||||
| 676 | ((void) 0); | - | ||||||||||||||||||||||||||||||
| 677 | case never executed: case 0x5346414F:code before this statement executed 4013 times by 5 tests: case 0x5346414F:Executed by:
never executed: 0x5346414F:case 0x5346414F:code before this statement executed 4013 times by 5 tests: case 0x5346414F:Executed by:
never executed: case 0x5346414F: | 0-4013 | ||||||||||||||||||||||||||||||
| 678 | - | |||||||||||||||||||||||||||||||
| 679 | - | |||||||||||||||||||||||||||||||
| 680 | ((void) 0); | - | ||||||||||||||||||||||||||||||
| 681 | case never executed: case 0x6969:code before this statement executed 4013 times by 5 tests: case 0x6969:Executed by:
never executed: 0x6969:case 0x6969:code before this statement executed 4013 times by 5 tests: case 0x6969:Executed by:
never executed: case 0x6969: | 0-4013 | ||||||||||||||||||||||||||||||
| 682 | - | |||||||||||||||||||||||||||||||
| 683 | - | |||||||||||||||||||||||||||||||
| 684 | - | |||||||||||||||||||||||||||||||
| 685 | - | |||||||||||||||||||||||||||||||
| 686 | ((void) 0); | - | ||||||||||||||||||||||||||||||
| 687 | case never executed: case 0x9FA0:code before this statement executed 4013 times by 5 tests: case 0x9FA0:Executed by:
never executed: 0x9FA0:case 0x9FA0:code before this statement executed 4013 times by 5 tests: case 0x9FA0:Executed by:
never executed: case 0x9FA0: | 0-4013 | ||||||||||||||||||||||||||||||
| 688 | - | |||||||||||||||||||||||||||||||
| 689 | - | |||||||||||||||||||||||||||||||
| 690 | return executed 4013 times by 5 tests: NO_LEAF_OPTIMIZATION;return NO_LEAF_OPTIMIZATION;Executed by:
executed 4013 times by 5 tests: return NO_LEAF_OPTIMIZATION;Executed by:
| 4013 | ||||||||||||||||||||||||||||||
| 691 | - | |||||||||||||||||||||||||||||||
| 692 | default executed 454 times by 3 tests: :default:Executed by:
executed 454 times by 3 tests: default:Executed by:
| 454 | ||||||||||||||||||||||||||||||
| 693 | return executed 454 times by 3 tests: OK_LEAF_OPTIMIZATION;return OK_LEAF_OPTIMIZATION;Executed by:
executed 454 times by 3 tests: return OK_LEAF_OPTIMIZATION;Executed by:
| 454 | ||||||||||||||||||||||||||||||
| 694 | } | - | ||||||||||||||||||||||||||||||
| 695 | } | - | ||||||||||||||||||||||||||||||
| 696 | FTSENT * | - | ||||||||||||||||||||||||||||||
| 697 | fts_read (register FTS *sp) | - | ||||||||||||||||||||||||||||||
| 698 | { | - | ||||||||||||||||||||||||||||||
| 699 | register FTSENT *p, *tmp; | - | ||||||||||||||||||||||||||||||
| 700 | register unsigned short int instr; | - | ||||||||||||||||||||||||||||||
| 701 | register char *t; | - | ||||||||||||||||||||||||||||||
| 702 | - | |||||||||||||||||||||||||||||||
| 703 | - | |||||||||||||||||||||||||||||||
| 704 | if (sp->fts_cur ==
| 1-1124821 | ||||||||||||||||||||||||||||||
| 705 | ((void *)0)
| 1-1124821 | ||||||||||||||||||||||||||||||
| 706 | || (
| 0-1124821 | ||||||||||||||||||||||||||||||
| 707 | return executed 1 time by 1 test: (return ( ((void *)0) );Executed by:
executed 1 time by 1 test: return ( ((void *)0) );Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 708 | ((void *)0) executed 1 time by 1 test: return ( ((void *)0) );Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 709 | ); executed 1 time by 1 test: return ( ((void *)0) );Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 710 | - | |||||||||||||||||||||||||||||||
| 711 | - | |||||||||||||||||||||||||||||||
| 712 | p = sp->fts_cur; | - | ||||||||||||||||||||||||||||||
| 713 | - | |||||||||||||||||||||||||||||||
| 714 | - | |||||||||||||||||||||||||||||||
| 715 | instr = p->fts_instr; | - | ||||||||||||||||||||||||||||||
| 716 | p->fts_instr = 3; | - | ||||||||||||||||||||||||||||||
| 717 | - | |||||||||||||||||||||||||||||||
| 718 | - | |||||||||||||||||||||||||||||||
| 719 | if (instr == 1
| 207901-916920 | ||||||||||||||||||||||||||||||
| 720 | p->fts_info = fts_stat(sp, p, | - | ||||||||||||||||||||||||||||||
| 721 | 0 | - | ||||||||||||||||||||||||||||||
| 722 | ); | - | ||||||||||||||||||||||||||||||
| 723 | return executed 207901 times by 4 tests: (p);return (p);Executed by:
executed 207901 times by 4 tests: return (p);Executed by:
| 207901 | ||||||||||||||||||||||||||||||
| 724 | } | - | ||||||||||||||||||||||||||||||
| 725 | - | |||||||||||||||||||||||||||||||
| 726 | ; | - | ||||||||||||||||||||||||||||||
| 727 | - | |||||||||||||||||||||||||||||||
| 728 | - | |||||||||||||||||||||||||||||||
| 729 | - | |||||||||||||||||||||||||||||||
| 730 | - | |||||||||||||||||||||||||||||||
| 731 | - | |||||||||||||||||||||||||||||||
| 732 | - | |||||||||||||||||||||||||||||||
| 733 | - | |||||||||||||||||||||||||||||||
| 734 | if (instr == 2
| 0-916920 | ||||||||||||||||||||||||||||||
| 735 | (p->fts_info == 12
| 0 | ||||||||||||||||||||||||||||||
| 736 | p->fts_info = fts_stat(sp, p, | - | ||||||||||||||||||||||||||||||
| 737 | 1 | - | ||||||||||||||||||||||||||||||
| 738 | ); | - | ||||||||||||||||||||||||||||||
| 739 | if (p->fts_info == 1
| 0 | ||||||||||||||||||||||||||||||
| 740 | if ((
| 0 | ||||||||||||||||||||||||||||||
| 741 | p->fts_errno = | - | ||||||||||||||||||||||||||||||
| 742 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 743 | ; | - | ||||||||||||||||||||||||||||||
| 744 | p->fts_info = 7; | - | ||||||||||||||||||||||||||||||
| 745 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||
| 746 | p->fts_flags |= 0x02; never executed: p->fts_flags |= 0x02; | 0 | ||||||||||||||||||||||||||||||
| 747 | } | - | ||||||||||||||||||||||||||||||
| 748 | goto never executed: check_for_dir;goto check_for_dir;never executed: goto check_for_dir; | 0 | ||||||||||||||||||||||||||||||
| 749 | } | - | ||||||||||||||||||||||||||||||
| 750 | - | |||||||||||||||||||||||||||||||
| 751 | - | |||||||||||||||||||||||||||||||
| 752 | if (p->fts_info == 1
| 101492-815428 | ||||||||||||||||||||||||||||||
| 753 | - | |||||||||||||||||||||||||||||||
| 754 | if (instr == 4
| 40401-61091 | ||||||||||||||||||||||||||||||
| 755 | ((
| 0-61084 | ||||||||||||||||||||||||||||||
| 756 | if (p->fts_flags & 0x02
| 0-40401 | ||||||||||||||||||||||||||||||
| 757 | ( never executed: void)close(p->fts_symfd);(void)close(p->fts_symfd);never executed: (void)close(p->fts_symfd); | 0 | ||||||||||||||||||||||||||||||
| 758 | if (sp->fts_child
| 0-40401 | ||||||||||||||||||||||||||||||
| 759 | fts_lfree(sp->fts_child); | - | ||||||||||||||||||||||||||||||
| 760 | sp->fts_child = | - | ||||||||||||||||||||||||||||||
| 761 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 762 | ; | - | ||||||||||||||||||||||||||||||
| 763 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 764 | p->fts_info = 6; | - | ||||||||||||||||||||||||||||||
| 765 | do { ; leave_dir (sp, p); ; } while ( | - | ||||||||||||||||||||||||||||||
| 766 | 0 | - | ||||||||||||||||||||||||||||||
| 767 | ); | - | ||||||||||||||||||||||||||||||
| 768 | return executed 40401 times by 6 tests: (p);return (p);Executed by:
executed 40401 times by 6 tests: return (p);Executed by:
| 40401 | ||||||||||||||||||||||||||||||
| 769 | } | - | ||||||||||||||||||||||||||||||
| 770 | - | |||||||||||||||||||||||||||||||
| 771 | - | |||||||||||||||||||||||||||||||
| 772 | if (sp->fts_child !=
| 0-61091 | ||||||||||||||||||||||||||||||
| 773 | ((void *)0)
| 0-61091 | ||||||||||||||||||||||||||||||
| 774 | && (
| 0 | ||||||||||||||||||||||||||||||
| 775 | (sp->fts_options &= ~(0x2000)); | - | ||||||||||||||||||||||||||||||
| 776 | fts_lfree(sp->fts_child); | - | ||||||||||||||||||||||||||||||
| 777 | sp->fts_child = | - | ||||||||||||||||||||||||||||||
| 778 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 779 | ; | - | ||||||||||||||||||||||||||||||
| 780 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 781 | if (sp->fts_child !=
| 0-61091 | ||||||||||||||||||||||||||||||
| 782 | ((void *)0)
| 0-61091 | ||||||||||||||||||||||||||||||
| 783 | ) { | - | ||||||||||||||||||||||||||||||
| 784 | if (fts_safe_changedir(sp, p, -1, p->fts_accpath)
| 0 | ||||||||||||||||||||||||||||||
| 785 | p->fts_errno = | - | ||||||||||||||||||||||||||||||
| 786 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 787 | ; | - | ||||||||||||||||||||||||||||||
| 788 | p->fts_flags |= 0x01; | - | ||||||||||||||||||||||||||||||
| 789 | for (p = sp->fts_child; p !=
| 0 | ||||||||||||||||||||||||||||||
| 790 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||
| 791 | ; | - | ||||||||||||||||||||||||||||||
| 792 | p = p->fts_link) | - | ||||||||||||||||||||||||||||||
| 793 | p->fts_accpath = never executed: p->fts_accpath = p->fts_parent->fts_accpath; | 0 | ||||||||||||||||||||||||||||||
| 794 | p->fts_parent->fts_accpath; never executed: p->fts_accpath = p->fts_parent->fts_accpath; | 0 | ||||||||||||||||||||||||||||||
| 795 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 796 | } never executed: else if ((end of block
| 0-40636 | ||||||||||||||||||||||||||||||
| 797 | ((void *)0)
| 20455-40636 | ||||||||||||||||||||||||||||||
| 798 | ) { | - | ||||||||||||||||||||||||||||||
| 799 | if ((
| 0-40636 | ||||||||||||||||||||||||||||||
| 800 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 801 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 802 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 803 | - | |||||||||||||||||||||||||||||||
| 804 | - | |||||||||||||||||||||||||||||||
| 805 | - | |||||||||||||||||||||||||||||||
| 806 | if (p->fts_errno
| 0-40628 | ||||||||||||||||||||||||||||||
| 807 | p->fts_info = 7; never executed: p->fts_info = 7; | 0 | ||||||||||||||||||||||||||||||
| 808 | do { ; leave_dir (sp, p); ; } while ( | - | ||||||||||||||||||||||||||||||
| 809 | 0 | - | ||||||||||||||||||||||||||||||
| 810 | ); | - | ||||||||||||||||||||||||||||||
| 811 | return executed 40636 times by 3 tests: (p);return (p);Executed by:
executed 40636 times by 3 tests: return (p);Executed by:
| 40636 | ||||||||||||||||||||||||||||||
| 812 | } | - | ||||||||||||||||||||||||||||||
| 813 | p = sp->fts_child; | - | ||||||||||||||||||||||||||||||
| 814 | sp->fts_child = | - | ||||||||||||||||||||||||||||||
| 815 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 816 | ; | - | ||||||||||||||||||||||||||||||
| 817 | goto executed 20455 times by 6 tests: name;goto name;Executed by:
executed 20455 times by 6 tests: goto name;Executed by:
| 20455 | ||||||||||||||||||||||||||||||
| 818 | } | - | ||||||||||||||||||||||||||||||
| 819 | - | |||||||||||||||||||||||||||||||
| 820 | - | |||||||||||||||||||||||||||||||
| 821 | next: code before this statement executed 815428 times by 6 tests: tmp = p;next:Executed by:
| 815428 | ||||||||||||||||||||||||||||||
| 822 | - | |||||||||||||||||||||||||||||||
| 823 | - | |||||||||||||||||||||||||||||||
| 824 | - | |||||||||||||||||||||||||||||||
| 825 | - | |||||||||||||||||||||||||||||||
| 826 | if (p->fts_link ==
| 27274-788154 | ||||||||||||||||||||||||||||||
| 827 | ((void *)0)
| 27274-788154 | ||||||||||||||||||||||||||||||
| 828 | && p->fts_parent->fts_dirp
| 6-27268 | ||||||||||||||||||||||||||||||
| 829 | { | - | ||||||||||||||||||||||||||||||
| 830 | p = tmp->fts_parent; | - | ||||||||||||||||||||||||||||||
| 831 | sp->fts_cur = p; | - | ||||||||||||||||||||||||||||||
| 832 | sp->fts_path[p->fts_pathlen] = '\0'; | - | ||||||||||||||||||||||||||||||
| 833 | - | |||||||||||||||||||||||||||||||
| 834 | if ((
| 3 | ||||||||||||||||||||||||||||||
| 835 | ((void *)0)
| 3 | ||||||||||||||||||||||||||||||
| 836 | ) | - | ||||||||||||||||||||||||||||||
| 837 | { | - | ||||||||||||||||||||||||||||||
| 838 | if ((
| 0-3 | ||||||||||||||||||||||||||||||
| 839 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 840 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 841 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 842 | goto executed 3 times by 3 tests: cd_dot_dot;goto cd_dot_dot;Executed by:
executed 3 times by 3 tests: goto cd_dot_dot;Executed by:
| 3 | ||||||||||||||||||||||||||||||
| 843 | } | - | ||||||||||||||||||||||||||||||
| 844 | - | |||||||||||||||||||||||||||||||
| 845 | free(tmp); | - | ||||||||||||||||||||||||||||||
| 846 | goto executed 3 times by 3 tests: name;goto name;Executed by:
executed 3 times by 3 tests: goto name;Executed by:
| 3 | ||||||||||||||||||||||||||||||
| 847 | } | - | ||||||||||||||||||||||||||||||
| 848 | - | |||||||||||||||||||||||||||||||
| 849 | if ((
| 27268-788154 | ||||||||||||||||||||||||||||||
| 850 | ((void *)0)
| 27268-788154 | ||||||||||||||||||||||||||||||
| 851 | ) { | - | ||||||||||||||||||||||||||||||
| 852 | sp->fts_cur = p; | - | ||||||||||||||||||||||||||||||
| 853 | free(tmp); | - | ||||||||||||||||||||||||||||||
| 854 | - | |||||||||||||||||||||||||||||||
| 855 | - | |||||||||||||||||||||||||||||||
| 856 | - | |||||||||||||||||||||||||||||||
| 857 | - | |||||||||||||||||||||||||||||||
| 858 | - | |||||||||||||||||||||||||||||||
| 859 | - | |||||||||||||||||||||||||||||||
| 860 | if (p->fts_level == 0
| 7918-780236 | ||||||||||||||||||||||||||||||
| 861 | if (restore_initial_cwd(sp)
| 0-7918 | ||||||||||||||||||||||||||||||
| 862 | (sp->fts_options |= (0x4000)); | - | ||||||||||||||||||||||||||||||
| 863 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 864 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 865 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 866 | } | - | ||||||||||||||||||||||||||||||
| 867 | free_dir(sp); | - | ||||||||||||||||||||||||||||||
| 868 | fts_load(sp, p); | - | ||||||||||||||||||||||||||||||
| 869 | setup_dir(sp); | - | ||||||||||||||||||||||||||||||
| 870 | goto executed 7918 times by 6 tests: check_for_dir;goto check_for_dir;Executed by:
executed 7918 times by 6 tests: goto check_for_dir;Executed by:
| 7918 | ||||||||||||||||||||||||||||||
| 871 | } | - | ||||||||||||||||||||||||||||||
| 872 | - | |||||||||||||||||||||||||||||||
| 873 | - | |||||||||||||||||||||||||||||||
| 874 | - | |||||||||||||||||||||||||||||||
| 875 | - | |||||||||||||||||||||||||||||||
| 876 | - | |||||||||||||||||||||||||||||||
| 877 | - | |||||||||||||||||||||||||||||||
| 878 | if (p->fts_instr == 4
| 0-780236 | ||||||||||||||||||||||||||||||
| 879 | goto never executed: next;goto next;never executed: goto next; | 0 | ||||||||||||||||||||||||||||||
| 880 | if (p->fts_instr == 2
| 0-780236 | ||||||||||||||||||||||||||||||
| 881 | p->fts_info = fts_stat(sp, p, | - | ||||||||||||||||||||||||||||||
| 882 | 1 | - | ||||||||||||||||||||||||||||||
| 883 | ); | - | ||||||||||||||||||||||||||||||
| 884 | if (p->fts_info == 1
| 0 | ||||||||||||||||||||||||||||||
| 885 | if ((
| 0 | ||||||||||||||||||||||||||||||
| 886 | p->fts_errno = | - | ||||||||||||||||||||||||||||||
| 887 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 888 | ; | - | ||||||||||||||||||||||||||||||
| 889 | p->fts_info = 7; | - | ||||||||||||||||||||||||||||||
| 890 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||
| 891 | p->fts_flags |= 0x02; never executed: p->fts_flags |= 0x02; | 0 | ||||||||||||||||||||||||||||||
| 892 | } | - | ||||||||||||||||||||||||||||||
| 893 | p->fts_instr = 3; | - | ||||||||||||||||||||||||||||||
| 894 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 895 | - | |||||||||||||||||||||||||||||||
| 896 | name: code before this statement executed 780236 times by 5 tests: t = sp->fts_path + (p->fts_parent->fts_path[p->fts_parent->fts_pathlen - 1] == '/'name:Executed by:
| 27-800667 | ||||||||||||||||||||||||||||||
| 897 | *t++ = '/'; | - | ||||||||||||||||||||||||||||||
| 898 | memmove(t, p->fts_name, p->fts_namelen + 1); | - | ||||||||||||||||||||||||||||||
| 899 | check_for_dir: code before this statement executed 800694 times by 6 tests: check_for_dir:Executed by:
| 800694 | ||||||||||||||||||||||||||||||
| 900 | sp->fts_cur = p; | - | ||||||||||||||||||||||||||||||
| 901 | if (p->fts_info == 11
| 6820-801792 | ||||||||||||||||||||||||||||||
| 902 | { | - | ||||||||||||||||||||||||||||||
| 903 | if (p->fts_statp->st_size == FTS_STAT_REQUIRED
| 345372-456420 | ||||||||||||||||||||||||||||||
| 904 | { | - | ||||||||||||||||||||||||||||||
| 905 | FTSENT *parent = p->fts_parent; | - | ||||||||||||||||||||||||||||||
| 906 | if (parent->fts_n_dirs_remaining == 0
| 4145-341227 | ||||||||||||||||||||||||||||||
| 907 | && (
| 42-4103 | ||||||||||||||||||||||||||||||
| 908 | && (
| 0-42 | ||||||||||||||||||||||||||||||
| 909 | && (
| 0 | ||||||||||||||||||||||||||||||
| 910 | == NOSTAT_LEAF_OPTIMIZATION)
| 0 | ||||||||||||||||||||||||||||||
| 911 | { | - | ||||||||||||||||||||||||||||||
| 912 | - | |||||||||||||||||||||||||||||||
| 913 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 914 | else | - | ||||||||||||||||||||||||||||||
| 915 | { | - | ||||||||||||||||||||||||||||||
| 916 | p->fts_info = fts_stat(sp, p, | - | ||||||||||||||||||||||||||||||
| 917 | 0 | - | ||||||||||||||||||||||||||||||
| 918 | ); | - | ||||||||||||||||||||||||||||||
| 919 | if ( | - | ||||||||||||||||||||||||||||||
| 920 | ((((
| 96490-248882 | ||||||||||||||||||||||||||||||
| 921 | p->fts_statp->st_mode
| 96490-248882 | ||||||||||||||||||||||||||||||
| 922 | )) & 0170000) == (0040000))
| 96490-248882 | ||||||||||||||||||||||||||||||
| 923 | - | |||||||||||||||||||||||||||||||
| 924 | && p->fts_level != 0
| 115-96375 | ||||||||||||||||||||||||||||||
| 925 | && 0 < parent->fts_n_dirs_remaining
| 41-96334 | ||||||||||||||||||||||||||||||
| 926 | && parent->fts_n_dirs_remaining != (nlink_t) -1
| 1136-95198 | ||||||||||||||||||||||||||||||
| 927 | parent->fts_n_dirs_remaining--; executed 95198 times by 4 tests: parent->fts_n_dirs_remaining--;Executed by:
| 95198 | ||||||||||||||||||||||||||||||
| 928 | } executed 345372 times by 6 tests: end of blockExecuted by:
| 345372 | ||||||||||||||||||||||||||||||
| 929 | } | - | ||||||||||||||||||||||||||||||
| 930 | else | - | ||||||||||||||||||||||||||||||
| 931 | do { if (!(p->fts_statp->st_size == FTS_NO_STAT_REQUIRED)
never executed: }abort ();executed 456420 times by 5 tests: while (end of blockExecuted by:
| 0-456420 | ||||||||||||||||||||||||||||||
| 932 | 0 | - | ||||||||||||||||||||||||||||||
| 933 | ); | - | ||||||||||||||||||||||||||||||
| 934 | } | - | ||||||||||||||||||||||||||||||
| 935 | - | |||||||||||||||||||||||||||||||
| 936 | if (p->fts_info == 1
| 101494-707118 | ||||||||||||||||||||||||||||||
| 937 | { | - | ||||||||||||||||||||||||||||||
| 938 | - | |||||||||||||||||||||||||||||||
| 939 | - | |||||||||||||||||||||||||||||||
| 940 | - | |||||||||||||||||||||||||||||||
| 941 | if (p->fts_level == 0
| 5119-96375 | ||||||||||||||||||||||||||||||
| 942 | sp->fts_dev = p->fts_statp->st_dev; executed 5119 times by 6 tests: sp->fts_dev = p->fts_statp->st_dev;Executed by:
| 5119 | ||||||||||||||||||||||||||||||
| 943 | ; | - | ||||||||||||||||||||||||||||||
| 944 | if (! enter_dir (sp, p)
| 0-101494 | ||||||||||||||||||||||||||||||
| 945 | { | - | ||||||||||||||||||||||||||||||
| 946 | - | |||||||||||||||||||||||||||||||
| 947 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 948 | = ( | - | ||||||||||||||||||||||||||||||
| 949 | 12 | - | ||||||||||||||||||||||||||||||
| 950 | ); | - | ||||||||||||||||||||||||||||||
| 951 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 952 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 953 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 954 | } | - | ||||||||||||||||||||||||||||||
| 955 | } executed 101494 times by 6 tests: end of blockExecuted by:
| 101494 | ||||||||||||||||||||||||||||||
| 956 | return executed 808612 times by 6 tests: p;return p;Executed by:
executed 808612 times by 6 tests: return p;Executed by:
| 808612 | ||||||||||||||||||||||||||||||
| 957 | } | - | ||||||||||||||||||||||||||||||
| 958 | cd_dot_dot: code before this statement executed 27268 times by 6 tests: cd_dot_dot:Executed by:
| 27268 | ||||||||||||||||||||||||||||||
| 959 | - | |||||||||||||||||||||||||||||||
| 960 | - | |||||||||||||||||||||||||||||||
| 961 | p = tmp->fts_parent; | - | ||||||||||||||||||||||||||||||
| 962 | sp->fts_cur = p; | - | ||||||||||||||||||||||||||||||
| 963 | free(tmp); | - | ||||||||||||||||||||||||||||||
| 964 | - | |||||||||||||||||||||||||||||||
| 965 | if (p->fts_level == (-1)
| 6819-20452 | ||||||||||||||||||||||||||||||
| 966 | - | |||||||||||||||||||||||||||||||
| 967 | - | |||||||||||||||||||||||||||||||
| 968 | - | |||||||||||||||||||||||||||||||
| 969 | - | |||||||||||||||||||||||||||||||
| 970 | free(p); | - | ||||||||||||||||||||||||||||||
| 971 | - | |||||||||||||||||||||||||||||||
| 972 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 973 | = (0); | - | ||||||||||||||||||||||||||||||
| 974 | return executed 6819 times by 6 tests: (sp->fts_cur = return (sp->fts_cur = ((void *)0) );Executed by:
executed 6819 times by 6 tests: return (sp->fts_cur = ((void *)0) );Executed by:
| 6819 | ||||||||||||||||||||||||||||||
| 975 | ((void *)0) executed 6819 times by 6 tests: return (sp->fts_cur = ((void *)0) );Executed by:
| 6819 | ||||||||||||||||||||||||||||||
| 976 | ); executed 6819 times by 6 tests: return (sp->fts_cur = ((void *)0) );Executed by:
| 6819 | ||||||||||||||||||||||||||||||
| 977 | } | - | ||||||||||||||||||||||||||||||
| 978 | - | |||||||||||||||||||||||||||||||
| 979 | do { if (!(p->fts_info != 11)
never executed: } while (abort (); | 0-20452 | ||||||||||||||||||||||||||||||
| 980 | 0 | - | ||||||||||||||||||||||||||||||
| 981 | ); | - | ||||||||||||||||||||||||||||||
| 982 | - | |||||||||||||||||||||||||||||||
| 983 | - | |||||||||||||||||||||||||||||||
| 984 | sp->fts_path[p->fts_pathlen] = '\0'; | - | ||||||||||||||||||||||||||||||
| 985 | - | |||||||||||||||||||||||||||||||
| 986 | - | |||||||||||||||||||||||||||||||
| 987 | - | |||||||||||||||||||||||||||||||
| 988 | - | |||||||||||||||||||||||||||||||
| 989 | - | |||||||||||||||||||||||||||||||
| 990 | - | |||||||||||||||||||||||||||||||
| 991 | - | |||||||||||||||||||||||||||||||
| 992 | if (p->fts_level == 0
| 4704-15748 | ||||||||||||||||||||||||||||||
| 993 | if (restore_initial_cwd(sp)
| 0-4704 | ||||||||||||||||||||||||||||||
| 994 | p->fts_errno = | - | ||||||||||||||||||||||||||||||
| 995 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 996 | ; | - | ||||||||||||||||||||||||||||||
| 997 | (sp->fts_options |= (0x4000)); | - | ||||||||||||||||||||||||||||||
| 998 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 999 | } executed 4704 times by 6 tests: else if (p->fts_flags & 0x02end of blockExecuted by:
| 0-15748 | ||||||||||||||||||||||||||||||
| 1000 | if ((!(sp->fts_options & (0x0004))
| 0 | ||||||||||||||||||||||||||||||
| 1001 | 1
| 0 | ||||||||||||||||||||||||||||||
| 1002 | ), 0) : fchdir (p->fts_symfd))
| 0 | ||||||||||||||||||||||||||||||
| 1003 | p->fts_errno = | - | ||||||||||||||||||||||||||||||
| 1004 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1005 | ; | - | ||||||||||||||||||||||||||||||
| 1006 | (sp->fts_options |= (0x4000)); | - | ||||||||||||||||||||||||||||||
| 1007 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1008 | (void)close(p->fts_symfd); | - | ||||||||||||||||||||||||||||||
| 1009 | } never executed: else if (!(p->fts_flags & 0x01)end of block
| 0-15748 | ||||||||||||||||||||||||||||||
| 1010 | fts_safe_changedir(sp, p->fts_parent, -1, "..")
| 1-15747 | ||||||||||||||||||||||||||||||
| 1011 | p->fts_errno = | - | ||||||||||||||||||||||||||||||
| 1012 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1013 | ; | - | ||||||||||||||||||||||||||||||
| 1014 | (sp->fts_options |= (0x4000)); | - | ||||||||||||||||||||||||||||||
| 1015 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||
| 1016 | - | |||||||||||||||||||||||||||||||
| 1017 | - | |||||||||||||||||||||||||||||||
| 1018 | - | |||||||||||||||||||||||||||||||
| 1019 | - | |||||||||||||||||||||||||||||||
| 1020 | if (p->fts_info != 2
| 0-20452 | ||||||||||||||||||||||||||||||
| 1021 | p->fts_info = p->fts_errno
| 2-20450 | ||||||||||||||||||||||||||||||
| 1022 | if (p->fts_errno == 0
| 2-20450 | ||||||||||||||||||||||||||||||
| 1023 | do { ; leave_dir (sp, p); ; } executed 20450 times by 6 tests: while (end of blockExecuted by:
| 20450 | ||||||||||||||||||||||||||||||
| 1024 | 0 | - | ||||||||||||||||||||||||||||||
| 1025 | ); | - | ||||||||||||||||||||||||||||||
| 1026 | } executed 20452 times by 6 tests: end of blockExecuted by:
| 20452 | ||||||||||||||||||||||||||||||
| 1027 | return executed 20452 times by 6 tests: (sp->fts_options & (0x4000)) ? return (sp->fts_options & (0x4000)) ? ((void *)0) : p;Executed by:
executed 20452 times by 6 tests: return (sp->fts_options & (0x4000)) ? ((void *)0) : p;Executed by:
| 20452 | ||||||||||||||||||||||||||||||
| 1028 | ((void *)0) executed 20452 times by 6 tests: return (sp->fts_options & (0x4000)) ? ((void *)0) : p;Executed by:
| 20452 | ||||||||||||||||||||||||||||||
| 1029 | : p; executed 20452 times by 6 tests: return (sp->fts_options & (0x4000)) ? ((void *)0) : p;Executed by:
| 20452 | ||||||||||||||||||||||||||||||
| 1030 | } | - | ||||||||||||||||||||||||||||||
| 1031 | int | - | ||||||||||||||||||||||||||||||
| 1032 | fts_set(FTS *sp __attribute__ ((__unused__)), FTSENT *p, int instr) | - | ||||||||||||||||||||||||||||||
| 1033 | { | - | ||||||||||||||||||||||||||||||
| 1034 | if (instr != 0
| 0-248470 | ||||||||||||||||||||||||||||||
| 1035 | instr != 3
| 0-40569 | ||||||||||||||||||||||||||||||
| 1036 | - | |||||||||||||||||||||||||||||||
| 1037 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1038 | = ( | - | ||||||||||||||||||||||||||||||
| 1039 | 22 | - | ||||||||||||||||||||||||||||||
| 1040 | ); | - | ||||||||||||||||||||||||||||||
| 1041 | return never executed: (1);return (1);never executed: return (1); | 0 | ||||||||||||||||||||||||||||||
| 1042 | } | - | ||||||||||||||||||||||||||||||
| 1043 | p->fts_instr = instr; | - | ||||||||||||||||||||||||||||||
| 1044 | return executed 248470 times by 6 tests: (0);return (0);Executed by:
executed 248470 times by 6 tests: return (0);Executed by:
| 248470 | ||||||||||||||||||||||||||||||
| 1045 | } | - | ||||||||||||||||||||||||||||||
| 1046 | - | |||||||||||||||||||||||||||||||
| 1047 | FTSENT * | - | ||||||||||||||||||||||||||||||
| 1048 | fts_children (register FTS *sp, int instr) | - | ||||||||||||||||||||||||||||||
| 1049 | { | - | ||||||||||||||||||||||||||||||
| 1050 | register FTSENT *p; | - | ||||||||||||||||||||||||||||||
| 1051 | int fd; | - | ||||||||||||||||||||||||||||||
| 1052 | - | |||||||||||||||||||||||||||||||
| 1053 | if (instr != 0
| 0 | ||||||||||||||||||||||||||||||
| 1054 | - | |||||||||||||||||||||||||||||||
| 1055 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1056 | = ( | - | ||||||||||||||||||||||||||||||
| 1057 | 22 | - | ||||||||||||||||||||||||||||||
| 1058 | ); | - | ||||||||||||||||||||||||||||||
| 1059 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1060 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1061 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1062 | } | - | ||||||||||||||||||||||||||||||
| 1063 | - | |||||||||||||||||||||||||||||||
| 1064 | - | |||||||||||||||||||||||||||||||
| 1065 | p = sp->fts_cur; | - | ||||||||||||||||||||||||||||||
| 1066 | - | |||||||||||||||||||||||||||||||
| 1067 | - | |||||||||||||||||||||||||||||||
| 1068 | - | |||||||||||||||||||||||||||||||
| 1069 | - | |||||||||||||||||||||||||||||||
| 1070 | - | |||||||||||||||||||||||||||||||
| 1071 | - | |||||||||||||||||||||||||||||||
| 1072 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1073 | = (0); | - | ||||||||||||||||||||||||||||||
| 1074 | - | |||||||||||||||||||||||||||||||
| 1075 | - | |||||||||||||||||||||||||||||||
| 1076 | if ((
| 0 | ||||||||||||||||||||||||||||||
| 1077 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1078 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1079 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1080 | - | |||||||||||||||||||||||||||||||
| 1081 | - | |||||||||||||||||||||||||||||||
| 1082 | if (p->fts_info == 9
| 0 | ||||||||||||||||||||||||||||||
| 1083 | return never executed: (p->fts_link);return (p->fts_link);never executed: return (p->fts_link); | 0 | ||||||||||||||||||||||||||||||
| 1084 | - | |||||||||||||||||||||||||||||||
| 1085 | - | |||||||||||||||||||||||||||||||
| 1086 | - | |||||||||||||||||||||||||||||||
| 1087 | - | |||||||||||||||||||||||||||||||
| 1088 | - | |||||||||||||||||||||||||||||||
| 1089 | - | |||||||||||||||||||||||||||||||
| 1090 | if (p->fts_info != 1
| 0 | ||||||||||||||||||||||||||||||
| 1091 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1092 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1093 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1094 | - | |||||||||||||||||||||||||||||||
| 1095 | - | |||||||||||||||||||||||||||||||
| 1096 | if (sp->fts_child !=
| 0 | ||||||||||||||||||||||||||||||
| 1097 | ((void *)0)
| 0 | ||||||||||||||||||||||||||||||
| 1098 | ) | - | ||||||||||||||||||||||||||||||
| 1099 | fts_lfree(sp->fts_child); never executed: fts_lfree(sp->fts_child); | 0 | ||||||||||||||||||||||||||||||
| 1100 | - | |||||||||||||||||||||||||||||||
| 1101 | if (instr == 0x2000
| 0 | ||||||||||||||||||||||||||||||
| 1102 | (sp->fts_options |= (0x2000)); | - | ||||||||||||||||||||||||||||||
| 1103 | instr = 2; | - | ||||||||||||||||||||||||||||||
| 1104 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||
| 1105 | instr = 1; never executed: instr = 1; | 0 | ||||||||||||||||||||||||||||||
| 1106 | if (p->fts_level != 0
| 0 | ||||||||||||||||||||||||||||||
| 1107 | (
| 0 | ||||||||||||||||||||||||||||||
| 1108 | return never executed: (sp->fts_child = fts_build(sp, instr));return (sp->fts_child = fts_build(sp, instr));never executed: return (sp->fts_child = fts_build(sp, instr)); | 0 | ||||||||||||||||||||||||||||||
| 1109 | - | |||||||||||||||||||||||||||||||
| 1110 | if ((
| 0 | ||||||||||||||||||||||||||||||
| 1111 | return never executed: (sp->fts_child = return (sp->fts_child = ((void *)0) );never executed: return (sp->fts_child = ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1112 | ((void *)0) never executed: return (sp->fts_child = ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1113 | ); never executed: return (sp->fts_child = ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1114 | sp->fts_child = fts_build(sp, instr); | - | ||||||||||||||||||||||||||||||
| 1115 | if ((
| 0 | ||||||||||||||||||||||||||||||
| 1116 | { | - | ||||||||||||||||||||||||||||||
| 1117 | cwd_advance_fd (sp, fd, | - | ||||||||||||||||||||||||||||||
| 1118 | 1 | - | ||||||||||||||||||||||||||||||
| 1119 | ); | - | ||||||||||||||||||||||||||||||
| 1120 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1121 | else | - | ||||||||||||||||||||||||||||||
| 1122 | { | - | ||||||||||||||||||||||||||||||
| 1123 | if (fchdir(fd)
| 0 | ||||||||||||||||||||||||||||||
| 1124 | { | - | ||||||||||||||||||||||||||||||
| 1125 | int saved_errno = | - | ||||||||||||||||||||||||||||||
| 1126 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1127 | ; | - | ||||||||||||||||||||||||||||||
| 1128 | close (fd); | - | ||||||||||||||||||||||||||||||
| 1129 | - | |||||||||||||||||||||||||||||||
| 1130 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1131 | = (saved_errno); | - | ||||||||||||||||||||||||||||||
| 1132 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 1133 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 1134 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 1135 | } | - | ||||||||||||||||||||||||||||||
| 1136 | close (fd); | - | ||||||||||||||||||||||||||||||
| 1137 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1138 | return never executed: (sp->fts_child);return (sp->fts_child);never executed: return (sp->fts_child); | 0 | ||||||||||||||||||||||||||||||
| 1139 | } | - | ||||||||||||||||||||||||||||||
| 1140 | - | |||||||||||||||||||||||||||||||
| 1141 | - | |||||||||||||||||||||||||||||||
| 1142 | - | |||||||||||||||||||||||||||||||
| 1143 | - | |||||||||||||||||||||||||||||||
| 1144 | - | |||||||||||||||||||||||||||||||
| 1145 | - | |||||||||||||||||||||||||||||||
| 1146 | static int | - | ||||||||||||||||||||||||||||||
| 1147 | fts_compare_ino (struct _ftsent const **a, struct _ftsent const **b) | - | ||||||||||||||||||||||||||||||
| 1148 | { | - | ||||||||||||||||||||||||||||||
| 1149 | return executed 11305644 times by 3 tests: (a[0]->fts_statp->st_ino < b[0]->fts_statp->st_ino ? -1return (a[0]->fts_statp->st_ino < b[0]->fts_statp->st_ino ? -1 : b[0]->fts_statp->st_ino < a[0]->fts_statp->st_ino ? 1 : 0);Executed by:
executed 11305644 times by 3 tests: return (a[0]->fts_statp->st_ino < b[0]->fts_statp->st_ino ? -1 : b[0]->fts_statp->st_ino < a[0]->fts_statp->st_ino ? 1 : 0);Executed by:
| 11305644 | ||||||||||||||||||||||||||||||
| 1150 | : b[0]->fts_statp->st_ino < a[0]->fts_statp->st_ino ? 1 : 0); executed 11305644 times by 3 tests: return (a[0]->fts_statp->st_ino < b[0]->fts_statp->st_ino ? -1 : b[0]->fts_statp->st_ino < a[0]->fts_statp->st_ino ? 1 : 0);Executed by:
| 11305644 | ||||||||||||||||||||||||||||||
| 1151 | } | - | ||||||||||||||||||||||||||||||
| 1152 | - | |||||||||||||||||||||||||||||||
| 1153 | - | |||||||||||||||||||||||||||||||
| 1154 | - | |||||||||||||||||||||||||||||||
| 1155 | static void | - | ||||||||||||||||||||||||||||||
| 1156 | set_stat_type (struct stat *st, unsigned int dtype) | - | ||||||||||||||||||||||||||||||
| 1157 | { | - | ||||||||||||||||||||||||||||||
| 1158 | mode_t type; | - | ||||||||||||||||||||||||||||||
| 1159 | switch (dtype) | - | ||||||||||||||||||||||||||||||
| 1160 | { | - | ||||||||||||||||||||||||||||||
| 1161 | case never executed: case DT_BLK :never executed: case DT_BLK : | 0 | ||||||||||||||||||||||||||||||
| 1162 | DT_BLK never executed: case DT_BLK : | 0 | ||||||||||||||||||||||||||||||
| 1163 | : never executed: case DT_BLK : | 0 | ||||||||||||||||||||||||||||||
| 1164 | type = | - | ||||||||||||||||||||||||||||||
| 1165 | 0060000 | - | ||||||||||||||||||||||||||||||
| 1166 | ; | - | ||||||||||||||||||||||||||||||
| 1167 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
| 1168 | case never executed: case DT_CHR :never executed: case DT_CHR : | 0 | ||||||||||||||||||||||||||||||
| 1169 | DT_CHR never executed: case DT_CHR : | 0 | ||||||||||||||||||||||||||||||
| 1170 | : never executed: case DT_CHR : | 0 | ||||||||||||||||||||||||||||||
| 1171 | type = | - | ||||||||||||||||||||||||||||||
| 1172 | 0020000 | - | ||||||||||||||||||||||||||||||
| 1173 | ; | - | ||||||||||||||||||||||||||||||
| 1174 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
| 1175 | case executed 96336 times by 5 tests: case DT_DIR :Executed by:
executed 96336 times by 5 tests: case DT_DIR :Executed by:
| 96336 | ||||||||||||||||||||||||||||||
| 1176 | DT_DIR executed 96336 times by 5 tests: case DT_DIR :Executed by:
| 96336 | ||||||||||||||||||||||||||||||
| 1177 | : executed 96336 times by 5 tests: case DT_DIR :Executed by:
| 96336 | ||||||||||||||||||||||||||||||
| 1178 | type = | - | ||||||||||||||||||||||||||||||
| 1179 | 0040000 | - | ||||||||||||||||||||||||||||||
| 1180 | ; | - | ||||||||||||||||||||||||||||||
| 1181 | break; executed 96336 times by 5 tests: break;Executed by:
| 96336 | ||||||||||||||||||||||||||||||
| 1182 | case executed 26 times by 2 tests: case DT_FIFO :Executed by:
executed 26 times by 2 tests: case DT_FIFO :Executed by:
| 26 | ||||||||||||||||||||||||||||||
| 1183 | DT_FIFO executed 26 times by 2 tests: case DT_FIFO :Executed by:
| 26 | ||||||||||||||||||||||||||||||
| 1184 | : executed 26 times by 2 tests: case DT_FIFO :Executed by:
| 26 | ||||||||||||||||||||||||||||||
| 1185 | type = | - | ||||||||||||||||||||||||||||||
| 1186 | 0010000 | - | ||||||||||||||||||||||||||||||
| 1187 | ; | - | ||||||||||||||||||||||||||||||
| 1188 | break; executed 26 times by 2 tests: break;Executed by:
| 26 | ||||||||||||||||||||||||||||||
| 1189 | case executed 645 times by 5 tests: case DT_LNK :Executed by:
executed 645 times by 5 tests: case DT_LNK :Executed by:
| 645 | ||||||||||||||||||||||||||||||
| 1190 | DT_LNK executed 645 times by 5 tests: case DT_LNK :Executed by:
| 645 | ||||||||||||||||||||||||||||||
| 1191 | : executed 645 times by 5 tests: case DT_LNK :Executed by:
| 645 | ||||||||||||||||||||||||||||||
| 1192 | type = | - | ||||||||||||||||||||||||||||||
| 1193 | 0120000 | - | ||||||||||||||||||||||||||||||
| 1194 | ; | - | ||||||||||||||||||||||||||||||
| 1195 | break; executed 645 times by 5 tests: break;Executed by:
| 645 | ||||||||||||||||||||||||||||||
| 1196 | case executed 703687 times by 5 tests: case DT_REG :Executed by:
executed 703687 times by 5 tests: case DT_REG :Executed by:
| 703687 | ||||||||||||||||||||||||||||||
| 1197 | DT_REG executed 703687 times by 5 tests: case DT_REG :Executed by:
| 703687 | ||||||||||||||||||||||||||||||
| 1198 | : executed 703687 times by 5 tests: case DT_REG :Executed by:
| 703687 | ||||||||||||||||||||||||||||||
| 1199 | type = | - | ||||||||||||||||||||||||||||||
| 1200 | 0100000 | - | ||||||||||||||||||||||||||||||
| 1201 | ; | - | ||||||||||||||||||||||||||||||
| 1202 | break; executed 703687 times by 5 tests: break;Executed by:
| 703687 | ||||||||||||||||||||||||||||||
| 1203 | case never executed: case DT_SOCK :never executed: case DT_SOCK : | 0 | ||||||||||||||||||||||||||||||
| 1204 | DT_SOCK never executed: case DT_SOCK : | 0 | ||||||||||||||||||||||||||||||
| 1205 | : never executed: case DT_SOCK : | 0 | ||||||||||||||||||||||||||||||
| 1206 | type = | - | ||||||||||||||||||||||||||||||
| 1207 | 0140000 | - | ||||||||||||||||||||||||||||||
| 1208 | ; | - | ||||||||||||||||||||||||||||||
| 1209 | break; never executed: break; | 0 | ||||||||||||||||||||||||||||||
| 1210 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||||||||||||||
| 1211 | type = 0; | - | ||||||||||||||||||||||||||||||
| 1212 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1213 | st->st_mode = type; | - | ||||||||||||||||||||||||||||||
| 1214 | } executed 800694 times by 6 tests: end of blockExecuted by:
| 800694 | ||||||||||||||||||||||||||||||
| 1215 | static FTSENT * | - | ||||||||||||||||||||||||||||||
| 1216 | - | |||||||||||||||||||||||||||||||
| 1217 | fts_build (register FTS *sp, int type) | - | ||||||||||||||||||||||||||||||
| 1218 | { | - | ||||||||||||||||||||||||||||||
| 1219 | register FTSENT *p, *head; | - | ||||||||||||||||||||||||||||||
| 1220 | register size_t nitems; | - | ||||||||||||||||||||||||||||||
| 1221 | FTSENT *tail; | - | ||||||||||||||||||||||||||||||
| 1222 | void *oldaddr; | - | ||||||||||||||||||||||||||||||
| 1223 | int saved_errno; | - | ||||||||||||||||||||||||||||||
| 1224 | - | |||||||||||||||||||||||||||||||
| 1225 | _Bool | - | ||||||||||||||||||||||||||||||
| 1226 | descend; | - | ||||||||||||||||||||||||||||||
| 1227 | - | |||||||||||||||||||||||||||||||
| 1228 | _Bool | - | ||||||||||||||||||||||||||||||
| 1229 | doadjust; | - | ||||||||||||||||||||||||||||||
| 1230 | ptrdiff_t level; | - | ||||||||||||||||||||||||||||||
| 1231 | size_t len, maxlen, new_len; | - | ||||||||||||||||||||||||||||||
| 1232 | char *cp; | - | ||||||||||||||||||||||||||||||
| 1233 | int dir_fd; | - | ||||||||||||||||||||||||||||||
| 1234 | FTSENT *cur = sp->fts_cur; | - | ||||||||||||||||||||||||||||||
| 1235 | - | |||||||||||||||||||||||||||||||
| 1236 | _Bool | - | ||||||||||||||||||||||||||||||
| 1237 | continue_readdir = !!cur->fts_dirp; | - | ||||||||||||||||||||||||||||||
| 1238 | size_t max_entries; | - | ||||||||||||||||||||||||||||||
| 1239 | - | |||||||||||||||||||||||||||||||
| 1240 | - | |||||||||||||||||||||||||||||||
| 1241 | - | |||||||||||||||||||||||||||||||
| 1242 | - | |||||||||||||||||||||||||||||||
| 1243 | if (continue_readdir
| 6-61091 | ||||||||||||||||||||||||||||||
| 1244 | { | - | ||||||||||||||||||||||||||||||
| 1245 | DIR *dp = cur->fts_dirp; | - | ||||||||||||||||||||||||||||||
| 1246 | dir_fd = dirfd (dp); | - | ||||||||||||||||||||||||||||||
| 1247 | if (dir_fd < 0
| 0-6 | ||||||||||||||||||||||||||||||
| 1248 | { | - | ||||||||||||||||||||||||||||||
| 1249 | do { closedir (cur->fts_dirp); cur->fts_dirp = | - | ||||||||||||||||||||||||||||||
| 1250 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1251 | ; } while (0); | - | ||||||||||||||||||||||||||||||
| 1252 | if (type == 3
| 0 | ||||||||||||||||||||||||||||||
| 1253 | { | - | ||||||||||||||||||||||||||||||
| 1254 | cur->fts_info = 4; | - | ||||||||||||||||||||||||||||||
| 1255 | cur->fts_errno = | - | ||||||||||||||||||||||||||||||
| 1256 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1257 | ; | - | ||||||||||||||||||||||||||||||
| 1258 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1259 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 1260 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 1261 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 1262 | } | - | ||||||||||||||||||||||||||||||
| 1263 | } executed 6 times by 3 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||
| 1264 | else | - | ||||||||||||||||||||||||||||||
| 1265 | { | - | ||||||||||||||||||||||||||||||
| 1266 | - | |||||||||||||||||||||||||||||||
| 1267 | - | |||||||||||||||||||||||||||||||
| 1268 | if ((
| 7-61084 | ||||||||||||||||||||||||||||||
| 1269 | -100
| 7-61084 | ||||||||||||||||||||||||||||||
| 1270 | ), cur->fts_accpath, ((((sp->fts_options & (0x0010)) && ! ((sp->fts_options & (0x0001)) && cur->fts_level == 0)) ?
| 7-61084 | ||||||||||||||||||||||||||||||
| 1271 | 0400000
| 7-61084 | ||||||||||||||||||||||||||||||
| 1272 | : 0) | ((sp->fts_options & (0x0800)) ?
| 7-61084 | ||||||||||||||||||||||||||||||
| 1273 | 01000000
| 7-61084 | ||||||||||||||||||||||||||||||
| 1274 | : 0)), &dir_fd)) ==
| 7-61084 | ||||||||||||||||||||||||||||||
| 1275 | ((void *)0)
| 7-61084 | ||||||||||||||||||||||||||||||
| 1276 | ) | - | ||||||||||||||||||||||||||||||
| 1277 | { | - | ||||||||||||||||||||||||||||||
| 1278 | if (type == 3
| 0-7 | ||||||||||||||||||||||||||||||
| 1279 | { | - | ||||||||||||||||||||||||||||||
| 1280 | cur->fts_info = 4; | - | ||||||||||||||||||||||||||||||
| 1281 | cur->fts_errno = | - | ||||||||||||||||||||||||||||||
| 1282 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1283 | ; | - | ||||||||||||||||||||||||||||||
| 1284 | } executed 7 times by 2 tests: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||||||||
| 1285 | return executed 7 times by 2 tests: return ((void *)0) ;Executed by:
executed 7 times by 2 tests: return ((void *)0) ;Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 1286 | ((void *)0) executed 7 times by 2 tests: return ((void *)0) ;Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 1287 | ; executed 7 times by 2 tests: return ((void *)0) ;Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 1288 | } | - | ||||||||||||||||||||||||||||||
| 1289 | - | |||||||||||||||||||||||||||||||
| 1290 | - | |||||||||||||||||||||||||||||||
| 1291 | - | |||||||||||||||||||||||||||||||
| 1292 | if (cur->fts_info == 11
| 0-61084 | ||||||||||||||||||||||||||||||
| 1293 | cur->fts_info = fts_stat(sp, cur, never executed: cur->fts_info = fts_stat(sp, cur, 0 ); | 0 | ||||||||||||||||||||||||||||||
| 1294 | 0 never executed: cur->fts_info = fts_stat(sp, cur, 0 ); | 0 | ||||||||||||||||||||||||||||||
| 1295 | ); never executed: cur->fts_info = fts_stat(sp, cur, 0 ); | 0 | ||||||||||||||||||||||||||||||
| 1296 | else if (sp->fts_options & 0x0100
| 650-60434 | ||||||||||||||||||||||||||||||
| 1297 | { | - | ||||||||||||||||||||||||||||||
| 1298 | - | |||||||||||||||||||||||||||||||
| 1299 | - | |||||||||||||||||||||||||||||||
| 1300 | - | |||||||||||||||||||||||||||||||
| 1301 | - | |||||||||||||||||||||||||||||||
| 1302 | - | |||||||||||||||||||||||||||||||
| 1303 | do { ; leave_dir (sp, cur); ; } while ( | - | ||||||||||||||||||||||||||||||
| 1304 | 0 | - | ||||||||||||||||||||||||||||||
| 1305 | ); | - | ||||||||||||||||||||||||||||||
| 1306 | fts_stat (sp, cur, | - | ||||||||||||||||||||||||||||||
| 1307 | 0 | - | ||||||||||||||||||||||||||||||
| 1308 | ); | - | ||||||||||||||||||||||||||||||
| 1309 | if (! enter_dir (sp, cur)
| 0-650 | ||||||||||||||||||||||||||||||
| 1310 | { | - | ||||||||||||||||||||||||||||||
| 1311 | - | |||||||||||||||||||||||||||||||
| 1312 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1313 | = ( | - | ||||||||||||||||||||||||||||||
| 1314 | 12 | - | ||||||||||||||||||||||||||||||
| 1315 | ); | - | ||||||||||||||||||||||||||||||
| 1316 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 1317 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 1318 | ; never executed: return ((void *)0) ; | 0 | ||||||||||||||||||||||||||||||
| 1319 | } | - | ||||||||||||||||||||||||||||||
| 1320 | } executed 650 times by 1 test: end of blockExecuted by:
| 650 | ||||||||||||||||||||||||||||||
| 1321 | } executed 61084 times by 6 tests: end of blockExecuted by:
| 61084 | ||||||||||||||||||||||||||||||
| 1322 | max_entries = sp->fts_compar
| 0-61090 | ||||||||||||||||||||||||||||||
| 1323 | (18446744073709551615UL) | - | ||||||||||||||||||||||||||||||
| 1324 | : 100000; | - | ||||||||||||||||||||||||||||||
| 1325 | if (continue_readdir
| 6-61084 | ||||||||||||||||||||||||||||||
| 1326 | { | - | ||||||||||||||||||||||||||||||
| 1327 | - | |||||||||||||||||||||||||||||||
| 1328 | - | |||||||||||||||||||||||||||||||
| 1329 | descend = | - | ||||||||||||||||||||||||||||||
| 1330 | 1 | - | ||||||||||||||||||||||||||||||
| 1331 | ; | - | ||||||||||||||||||||||||||||||
| 1332 | } executed 6 times by 3 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||||||||
| 1333 | else | - | ||||||||||||||||||||||||||||||
| 1334 | { | - | ||||||||||||||||||||||||||||||
| 1335 | - | |||||||||||||||||||||||||||||||
| 1336 | - | |||||||||||||||||||||||||||||||
| 1337 | descend = (type != 2
| 0-61084 | ||||||||||||||||||||||||||||||
| 1338 | && ! ((
| 54-42902 | ||||||||||||||||||||||||||||||
| 1339 | && ! (sp->fts_options & (0x0020))
| 0-18128 | ||||||||||||||||||||||||||||||
| 1340 | && cur->fts_statp->st_nlink == MIN_DIR_NLINK
| 4467-13661 | ||||||||||||||||||||||||||||||
| 1341 | && (
| 454-4013 | ||||||||||||||||||||||||||||||
| 1342 | != NO_LEAF_OPTIMIZATION)
| 454-4013 | ||||||||||||||||||||||||||||||
| 1343 | if (descend
| 0-60630 | ||||||||||||||||||||||||||||||
| 1344 | { | - | ||||||||||||||||||||||||||||||
| 1345 | if ((
| 56-61028 | ||||||||||||||||||||||||||||||
| 1346 | dir_fd = executed 61028 times by 6 tests: dir_fd = rpl_fcntl (dir_fd, 1030 , 2 + 1);Executed by:
| 61028 | ||||||||||||||||||||||||||||||
| 1347 | rpl_fcntl executed 61028 times by 6 tests: dir_fd = rpl_fcntl (dir_fd, 1030 , 2 + 1);Executed by:
| 61028 | ||||||||||||||||||||||||||||||
| 1348 | (dir_fd, executed 61028 times by 6 tests: dir_fd = rpl_fcntl (dir_fd, 1030 , 2 + 1);Executed by:
| 61028 | ||||||||||||||||||||||||||||||
| 1349 | 1030 executed 61028 times by 6 tests: dir_fd = rpl_fcntl (dir_fd, 1030 , 2 + 1);Executed by:
| 61028 | ||||||||||||||||||||||||||||||
| 1350 | , executed 61028 times by 6 tests: dir_fd = rpl_fcntl (dir_fd, 1030 , 2 + 1);Executed by:
| 61028 | ||||||||||||||||||||||||||||||
| 1351 | 2 executed 61028 times by 6 tests: dir_fd = rpl_fcntl (dir_fd, 1030 , 2 + 1);Executed by:
| 61028 | ||||||||||||||||||||||||||||||
| 1352 | + 1); executed 61028 times by 6 tests: dir_fd = rpl_fcntl (dir_fd, 1030 , 2 + 1);Executed by:
| 61028 | ||||||||||||||||||||||||||||||
| 1353 | if (dir_fd < 0
| 0-61084 | ||||||||||||||||||||||||||||||
| 1354 | ((void *)0)
| 0-61084 | ||||||||||||||||||||||||||||||
| 1355 | )
| 0-61084 | ||||||||||||||||||||||||||||||
| 1356 | if (descend
| 0 | ||||||||||||||||||||||||||||||
| 1357 | cur->fts_errno = never executed: cur->fts_errno = (*__errno_location ()) ; | 0 | ||||||||||||||||||||||||||||||
| 1358 | (*__errno_location ()) never executed: cur->fts_errno = (*__errno_location ()) ; | 0 | ||||||||||||||||||||||||||||||
| 1359 | ; never executed: cur->fts_errno = (*__errno_location ()) ; | 0 | ||||||||||||||||||||||||||||||
| 1360 | cur->fts_flags |= 0x01; | - | ||||||||||||||||||||||||||||||
| 1361 | descend = | - | ||||||||||||||||||||||||||||||
| 1362 | 0 | - | ||||||||||||||||||||||||||||||
| 1363 | ; | - | ||||||||||||||||||||||||||||||
| 1364 | do { closedir (cur->fts_dirp); cur->fts_dirp = | - | ||||||||||||||||||||||||||||||
| 1365 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1366 | ; } while (0); | - | ||||||||||||||||||||||||||||||
| 1367 | if ((
| 0 | ||||||||||||||||||||||||||||||
| 1368 | close (dir_fd); never executed: close (dir_fd); | 0 | ||||||||||||||||||||||||||||||
| 1369 | cur->fts_dirp = | - | ||||||||||||||||||||||||||||||
| 1370 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1371 | ; | - | ||||||||||||||||||||||||||||||
| 1372 | } never executed: elseend of block | 0 | ||||||||||||||||||||||||||||||
| 1373 | descend = executed 61084 times by 6 tests: descend = 1 ;Executed by:
| 61084 | ||||||||||||||||||||||||||||||
| 1374 | 1 executed 61084 times by 6 tests: descend = 1 ;Executed by:
| 61084 | ||||||||||||||||||||||||||||||
| 1375 | ; executed 61084 times by 6 tests: descend = 1 ;Executed by:
| 61084 | ||||||||||||||||||||||||||||||
| 1376 | } | - | ||||||||||||||||||||||||||||||
| 1377 | } executed 61084 times by 6 tests: end of blockExecuted by:
| 61084 | ||||||||||||||||||||||||||||||
| 1378 | len = (cur->fts_path[cur->fts_pathlen - 1] == '/'
| 4-61086 | ||||||||||||||||||||||||||||||
| 1379 | if ((
| 56-61034 | ||||||||||||||||||||||||||||||
| 1380 | cp = sp->fts_path + len; | - | ||||||||||||||||||||||||||||||
| 1381 | *cp++ = '/'; | - | ||||||||||||||||||||||||||||||
| 1382 | } executed 56 times by 3 tests: else {end of blockExecuted by:
| 56 | ||||||||||||||||||||||||||||||
| 1383 | - | |||||||||||||||||||||||||||||||
| 1384 | cp = | - | ||||||||||||||||||||||||||||||
| 1385 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1386 | ; | - | ||||||||||||||||||||||||||||||
| 1387 | } executed 61034 times by 6 tests: end of blockExecuted by:
| 61034 | ||||||||||||||||||||||||||||||
| 1388 | len++; | - | ||||||||||||||||||||||||||||||
| 1389 | maxlen = sp->fts_pathlen - len; | - | ||||||||||||||||||||||||||||||
| 1390 | - | |||||||||||||||||||||||||||||||
| 1391 | level = cur->fts_level + 1; | - | ||||||||||||||||||||||||||||||
| 1392 | - | |||||||||||||||||||||||||||||||
| 1393 | - | |||||||||||||||||||||||||||||||
| 1394 | doadjust = | - | ||||||||||||||||||||||||||||||
| 1395 | 0 | - | ||||||||||||||||||||||||||||||
| 1396 | ; | - | ||||||||||||||||||||||||||||||
| 1397 | head = | - | ||||||||||||||||||||||||||||||
| 1398 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1399 | ; | - | ||||||||||||||||||||||||||||||
| 1400 | tail = | - | ||||||||||||||||||||||||||||||
| 1401 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1402 | ; | - | ||||||||||||||||||||||||||||||
| 1403 | nitems = 0; | - | ||||||||||||||||||||||||||||||
| 1404 | while (cur->fts_dirp
| 0-983942 | ||||||||||||||||||||||||||||||
| 1405 | size_t d_namelen; | - | ||||||||||||||||||||||||||||||
| 1406 | - | |||||||||||||||||||||||||||||||
| 1407 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1408 | = (0); | - | ||||||||||||||||||||||||||||||
| 1409 | struct dirent *dp = readdir(cur->fts_dirp); | - | ||||||||||||||||||||||||||||||
| 1410 | if (dp ==
| 61084-922858 | ||||||||||||||||||||||||||||||
| 1411 | ((void *)0)
| 61084-922858 | ||||||||||||||||||||||||||||||
| 1412 | ) { | - | ||||||||||||||||||||||||||||||
| 1413 | if ( | - | ||||||||||||||||||||||||||||||
| 1414 | (*
| 2-61082 | ||||||||||||||||||||||||||||||
| 1415 | ) { | - | ||||||||||||||||||||||||||||||
| 1416 | cur->fts_errno = | - | ||||||||||||||||||||||||||||||
| 1417 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1418 | ; | - | ||||||||||||||||||||||||||||||
| 1419 | - | |||||||||||||||||||||||||||||||
| 1420 | - | |||||||||||||||||||||||||||||||
| 1421 | cur->fts_info = (continue_readdir
| 0-2 | ||||||||||||||||||||||||||||||
| 1422 | ? 7 : 4; | - | ||||||||||||||||||||||||||||||
| 1423 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||||||||
| 1424 | break; executed 61084 times by 6 tests: break;Executed by:
| 61084 | ||||||||||||||||||||||||||||||
| 1425 | } | - | ||||||||||||||||||||||||||||||
| 1426 | if (!(sp->fts_options & (0x0020))
| 0-922858 | ||||||||||||||||||||||||||||||
| 1427 | continue; executed 122164 times by 6 tests: continue;Executed by:
| 122164 | ||||||||||||||||||||||||||||||
| 1428 | - | |||||||||||||||||||||||||||||||
| 1429 | d_namelen = | - | ||||||||||||||||||||||||||||||
| 1430 | (strlen (( | - | ||||||||||||||||||||||||||||||
| 1431 | dp | - | ||||||||||||||||||||||||||||||
| 1432 | )->d_name)) | - | ||||||||||||||||||||||||||||||
| 1433 | ; | - | ||||||||||||||||||||||||||||||
| 1434 | p = fts_alloc (sp, dp->d_name, d_namelen); | - | ||||||||||||||||||||||||||||||
| 1435 | if (!p
| 0-800694 | ||||||||||||||||||||||||||||||
| 1436 | goto never executed: mem1;goto mem1;never executed: goto mem1; | 0 | ||||||||||||||||||||||||||||||
| 1437 | if (d_namelen >= maxlen
| 7-800687 | ||||||||||||||||||||||||||||||
| 1438 | - | |||||||||||||||||||||||||||||||
| 1439 | oldaddr = sp->fts_path; | - | ||||||||||||||||||||||||||||||
| 1440 | if (! fts_palloc(sp, d_namelen + len + 1)
| 0-7 | ||||||||||||||||||||||||||||||
| 1441 | - | |||||||||||||||||||||||||||||||
| 1442 | - | |||||||||||||||||||||||||||||||
| 1443 | - | |||||||||||||||||||||||||||||||
| 1444 | - | |||||||||||||||||||||||||||||||
| 1445 | - | |||||||||||||||||||||||||||||||
| 1446 | mem1: saved_errno = | - | ||||||||||||||||||||||||||||||
| 1447 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1448 | ; | - | ||||||||||||||||||||||||||||||
| 1449 | free(p); | - | ||||||||||||||||||||||||||||||
| 1450 | fts_lfree(head); | - | ||||||||||||||||||||||||||||||
| 1451 | do { closedir (cur->fts_dirp); cur->fts_dirp = | - | ||||||||||||||||||||||||||||||
| 1452 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1453 | ; } while (0); | - | ||||||||||||||||||||||||||||||
| 1454 | cur->fts_info = 7; | - | ||||||||||||||||||||||||||||||
| 1455 | (sp->fts_options |= (0x4000)); | - | ||||||||||||||||||||||||||||||
| 1456 | - | |||||||||||||||||||||||||||||||
| 1457 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1458 | = (saved_errno); | - | ||||||||||||||||||||||||||||||
| 1459 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1460 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1461 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1462 | } | - | ||||||||||||||||||||||||||||||
| 1463 | - | |||||||||||||||||||||||||||||||
| 1464 | if (oldaddr != sp->fts_path
| 0-7 | ||||||||||||||||||||||||||||||
| 1465 | doadjust = | - | ||||||||||||||||||||||||||||||
| 1466 | 1 | - | ||||||||||||||||||||||||||||||
| 1467 | ; | - | ||||||||||||||||||||||||||||||
| 1468 | if ((
| 0-7 | ||||||||||||||||||||||||||||||
| 1469 | cp = sp->fts_path + len; never executed: cp = sp->fts_path + len; | 0 | ||||||||||||||||||||||||||||||
| 1470 | } executed 7 times by 3 tests: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||||||||
| 1471 | maxlen = sp->fts_pathlen - len; | - | ||||||||||||||||||||||||||||||
| 1472 | } executed 7 times by 3 tests: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||||||||
| 1473 | - | |||||||||||||||||||||||||||||||
| 1474 | new_len = len + d_namelen; | - | ||||||||||||||||||||||||||||||
| 1475 | if (new_len < len
| 0-800694 | ||||||||||||||||||||||||||||||
| 1476 | - | |||||||||||||||||||||||||||||||
| 1477 | - | |||||||||||||||||||||||||||||||
| 1478 | - | |||||||||||||||||||||||||||||||
| 1479 | - | |||||||||||||||||||||||||||||||
| 1480 | - | |||||||||||||||||||||||||||||||
| 1481 | - | |||||||||||||||||||||||||||||||
| 1482 | free(p); | - | ||||||||||||||||||||||||||||||
| 1483 | fts_lfree(head); | - | ||||||||||||||||||||||||||||||
| 1484 | do { closedir (cur->fts_dirp); cur->fts_dirp = | - | ||||||||||||||||||||||||||||||
| 1485 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1486 | ; } while (0); | - | ||||||||||||||||||||||||||||||
| 1487 | cur->fts_info = 7; | - | ||||||||||||||||||||||||||||||
| 1488 | (sp->fts_options |= (0x4000)); | - | ||||||||||||||||||||||||||||||
| 1489 | - | |||||||||||||||||||||||||||||||
| 1490 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1491 | = ( | - | ||||||||||||||||||||||||||||||
| 1492 | 36 | - | ||||||||||||||||||||||||||||||
| 1493 | ); | - | ||||||||||||||||||||||||||||||
| 1494 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1495 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1496 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1497 | } | - | ||||||||||||||||||||||||||||||
| 1498 | p->fts_level = level; | - | ||||||||||||||||||||||||||||||
| 1499 | p->fts_parent = sp->fts_cur; | - | ||||||||||||||||||||||||||||||
| 1500 | p->fts_pathlen = new_len; | - | ||||||||||||||||||||||||||||||
| 1501 | - | |||||||||||||||||||||||||||||||
| 1502 | - | |||||||||||||||||||||||||||||||
| 1503 | - | |||||||||||||||||||||||||||||||
| 1504 | p->fts_statp->st_ino = (dp)->d_ino; | - | ||||||||||||||||||||||||||||||
| 1505 | - | |||||||||||||||||||||||||||||||
| 1506 | - | |||||||||||||||||||||||||||||||
| 1507 | if ((
| 65-800629 | ||||||||||||||||||||||||||||||
| 1508 | p->fts_accpath = p->fts_path; | - | ||||||||||||||||||||||||||||||
| 1509 | memmove(cp, p->fts_name, p->fts_namelen + 1); | - | ||||||||||||||||||||||||||||||
| 1510 | } executed 65 times by 3 tests: elseend of blockExecuted by:
| 65 | ||||||||||||||||||||||||||||||
| 1511 | p->fts_accpath = p->fts_name; executed 800629 times by 6 tests: p->fts_accpath = p->fts_name;Executed by:
| 800629 | ||||||||||||||||||||||||||||||
| 1512 | - | |||||||||||||||||||||||||||||||
| 1513 | if (sp->fts_compar ==
| 0-800694 | ||||||||||||||||||||||||||||||
| 1514 | ((void *)0)
| 0-800694 | ||||||||||||||||||||||||||||||
| 1515 | || (
| 0 | ||||||||||||||||||||||||||||||
| 1516 | - | |||||||||||||||||||||||||||||||
| 1517 | _Bool | - | ||||||||||||||||||||||||||||||
| 1518 | skip_stat = ((
| 65-800629 | ||||||||||||||||||||||||||||||
| 1519 | && (
| 290208-510421 | ||||||||||||||||||||||||||||||
| 1520 | && ((
| 0-510421 | ||||||||||||||||||||||||||||||
| 1521 | DT_UNKNOWN
| 0-510421 | ||||||||||||||||||||||||||||||
| 1522 | )
| 0-510421 | ||||||||||||||||||||||||||||||
| 1523 | && ! ((dp)->d_type == (
| 54001-456420 | ||||||||||||||||||||||||||||||
| 1524 | DT_DIR
| 54001-456420 | ||||||||||||||||||||||||||||||
| 1525 | ))
| 54001-456420 | ||||||||||||||||||||||||||||||
| 1526 | p->fts_info = 11; | - | ||||||||||||||||||||||||||||||
| 1527 | - | |||||||||||||||||||||||||||||||
| 1528 | - | |||||||||||||||||||||||||||||||
| 1529 | set_stat_type (p->fts_statp, ((dp)->d_type)); | - | ||||||||||||||||||||||||||||||
| 1530 | fts_set_stat_required(p, !skip_stat); | - | ||||||||||||||||||||||||||||||
| 1531 | } executed 800694 times by 6 tests: else {end of blockExecuted by:
| 800694 | ||||||||||||||||||||||||||||||
| 1532 | p->fts_info = fts_stat(sp, p, | - | ||||||||||||||||||||||||||||||
| 1533 | 0 | - | ||||||||||||||||||||||||||||||
| 1534 | ); | - | ||||||||||||||||||||||||||||||
| 1535 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1536 | - | |||||||||||||||||||||||||||||||
| 1537 | - | |||||||||||||||||||||||||||||||
| 1538 | p->fts_link = | - | ||||||||||||||||||||||||||||||
| 1539 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1540 | ; | - | ||||||||||||||||||||||||||||||
| 1541 | if (head ==
| 20458-780236 | ||||||||||||||||||||||||||||||
| 1542 | ((void *)0)
| 20458-780236 | ||||||||||||||||||||||||||||||
| 1543 | ) | - | ||||||||||||||||||||||||||||||
| 1544 | head = tail = p; executed 20458 times by 6 tests: head = tail = p;Executed by:
| 20458 | ||||||||||||||||||||||||||||||
| 1545 | else { | - | ||||||||||||||||||||||||||||||
| 1546 | tail->fts_link = p; | - | ||||||||||||||||||||||||||||||
| 1547 | tail = p; | - | ||||||||||||||||||||||||||||||
| 1548 | } executed 780236 times by 5 tests: end of blockExecuted by:
| 780236 | ||||||||||||||||||||||||||||||
| 1549 | ++nitems; | - | ||||||||||||||||||||||||||||||
| 1550 | if (max_entries <= nitems
| 6-800688 | ||||||||||||||||||||||||||||||
| 1551 | - | |||||||||||||||||||||||||||||||
| 1552 | - | |||||||||||||||||||||||||||||||
| 1553 | - | |||||||||||||||||||||||||||||||
| 1554 | goto executed 6 times by 3 tests: break_without_closedir;goto break_without_closedir;Executed by:
executed 6 times by 3 tests: goto break_without_closedir;Executed by:
| 6 | ||||||||||||||||||||||||||||||
| 1555 | } | - | ||||||||||||||||||||||||||||||
| 1556 | } executed 800688 times by 6 tests: end of blockExecuted by:
| 800688 | ||||||||||||||||||||||||||||||
| 1557 | - | |||||||||||||||||||||||||||||||
| 1558 | if (cur->fts_dirp
| 0-61084 | ||||||||||||||||||||||||||||||
| 1559 | do { closedir (cur->fts_dirp); cur->fts_dirp = | - | ||||||||||||||||||||||||||||||
| 1560 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1561 | ; } executed 61084 times by 6 tests: while (0);end of blockExecuted by:
| 61084 | ||||||||||||||||||||||||||||||
| 1562 | - | |||||||||||||||||||||||||||||||
| 1563 | break_without_closedir: code before this statement executed 61084 times by 6 tests: break_without_closedir:Executed by:
| 61084 | ||||||||||||||||||||||||||||||
| 1564 | - | |||||||||||||||||||||||||||||||
| 1565 | - | |||||||||||||||||||||||||||||||
| 1566 | - | |||||||||||||||||||||||||||||||
| 1567 | - | |||||||||||||||||||||||||||||||
| 1568 | - | |||||||||||||||||||||||||||||||
| 1569 | if (doadjust
| 7-61083 | ||||||||||||||||||||||||||||||
| 1570 | fts_padjust(sp, head); executed 7 times by 3 tests: fts_padjust(sp, head);Executed by:
| 7 | ||||||||||||||||||||||||||||||
| 1571 | - | |||||||||||||||||||||||||||||||
| 1572 | - | |||||||||||||||||||||||||||||||
| 1573 | - | |||||||||||||||||||||||||||||||
| 1574 | - | |||||||||||||||||||||||||||||||
| 1575 | - | |||||||||||||||||||||||||||||||
| 1576 | if ((
| 56-61034 | ||||||||||||||||||||||||||||||
| 1577 | if (len == sp->fts_pathlen
| 0-56 | ||||||||||||||||||||||||||||||
| 1578 | -- executed 1 time by 1 test: cp;--cp;Executed by:
executed 1 time by 1 test: --cp;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 1579 | *cp = '\0'; | - | ||||||||||||||||||||||||||||||
| 1580 | } executed 56 times by 3 tests: end of blockExecuted by:
| 56 | ||||||||||||||||||||||||||||||
| 1581 | if (!continue_readdir
| 0-61084 | ||||||||||||||||||||||||||||||
| 1582 | (
| 0-40629 | ||||||||||||||||||||||||||||||
| 1583 | ? restore_initial_cwd(sp)
| 0-40629 | ||||||||||||||||||||||||||||||
| 1584 | : fts_safe_changedir(sp, cur->fts_parent, -1, ".."))
| 0-40629 | ||||||||||||||||||||||||||||||
| 1585 | cur->fts_info = 7; | - | ||||||||||||||||||||||||||||||
| 1586 | (sp->fts_options |= (0x4000)); | - | ||||||||||||||||||||||||||||||
| 1587 | fts_lfree(head); | - | ||||||||||||||||||||||||||||||
| 1588 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1589 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1590 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1591 | } | - | ||||||||||||||||||||||||||||||
| 1592 | - | |||||||||||||||||||||||||||||||
| 1593 | - | |||||||||||||||||||||||||||||||
| 1594 | if (!nitems
| 20458-40632 | ||||||||||||||||||||||||||||||
| 1595 | if (type == 3
| 0-40632 | ||||||||||||||||||||||||||||||
| 1596 | && cur->fts_info != 4
| 0-40631 | ||||||||||||||||||||||||||||||
| 1597 | cur->fts_info = 6; executed 40631 times by 3 tests: cur->fts_info = 6;Executed by:
| 40631 | ||||||||||||||||||||||||||||||
| 1598 | fts_lfree(head); | - | ||||||||||||||||||||||||||||||
| 1599 | return executed 40632 times by 3 tests: (return ( ((void *)0) );Executed by:
executed 40632 times by 3 tests: return ( ((void *)0) );Executed by:
| 40632 | ||||||||||||||||||||||||||||||
| 1600 | ((void *)0) executed 40632 times by 3 tests: return ( ((void *)0) );Executed by:
| 40632 | ||||||||||||||||||||||||||||||
| 1601 | ); executed 40632 times by 3 tests: return ( ((void *)0) );Executed by:
| 40632 | ||||||||||||||||||||||||||||||
| 1602 | } | - | ||||||||||||||||||||||||||||||
| 1603 | - | |||||||||||||||||||||||||||||||
| 1604 | - | |||||||||||||||||||||||||||||||
| 1605 | - | |||||||||||||||||||||||||||||||
| 1606 | - | |||||||||||||||||||||||||||||||
| 1607 | - | |||||||||||||||||||||||||||||||
| 1608 | if (nitems > _FTS_INODE_SORT_DIR_ENTRIES_THRESHOLD
| 14-20444 | ||||||||||||||||||||||||||||||
| 1609 | && !sp->fts_compar
| 0-14 | ||||||||||||||||||||||||||||||
| 1610 | && dirent_inode_sort_may_be_useful (cur)
| 0-14 | ||||||||||||||||||||||||||||||
| 1611 | sp->fts_compar = fts_compare_ino; | - | ||||||||||||||||||||||||||||||
| 1612 | head = fts_sort (sp, head, nitems); | - | ||||||||||||||||||||||||||||||
| 1613 | sp->fts_compar = | - | ||||||||||||||||||||||||||||||
| 1614 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1615 | ; | - | ||||||||||||||||||||||||||||||
| 1616 | } executed 14 times by 3 tests: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||||||||
| 1617 | - | |||||||||||||||||||||||||||||||
| 1618 | - | |||||||||||||||||||||||||||||||
| 1619 | if (sp->fts_compar
| 0-20458 | ||||||||||||||||||||||||||||||
| 1620 | head = fts_sort(sp, head, nitems); never executed: head = fts_sort(sp, head, nitems); | 0 | ||||||||||||||||||||||||||||||
| 1621 | return executed 20458 times by 6 tests: (head);return (head);Executed by:
executed 20458 times by 6 tests: return (head);Executed by:
| 20458 | ||||||||||||||||||||||||||||||
| 1622 | } | - | ||||||||||||||||||||||||||||||
| 1623 | static unsigned short int | - | ||||||||||||||||||||||||||||||
| 1624 | - | |||||||||||||||||||||||||||||||
| 1625 | fts_stat(FTS *sp, register FTSENT *p, | - | ||||||||||||||||||||||||||||||
| 1626 | _Bool | - | ||||||||||||||||||||||||||||||
| 1627 | follow) | - | ||||||||||||||||||||||||||||||
| 1628 | { | - | ||||||||||||||||||||||||||||||
| 1629 | struct stat *sbp = p->fts_statp; | - | ||||||||||||||||||||||||||||||
| 1630 | - | |||||||||||||||||||||||||||||||
| 1631 | if (p->fts_level == 0
| 827-552584 | ||||||||||||||||||||||||||||||
| 1632 | follow = executed 827 times by 4 tests: follow = 1 ;Executed by:
| 827 | ||||||||||||||||||||||||||||||
| 1633 | 1 executed 827 times by 4 tests: follow = 1 ;Executed by:
| 827 | ||||||||||||||||||||||||||||||
| 1634 | ; executed 827 times by 4 tests: follow = 1 ;Executed by:
| 827 | ||||||||||||||||||||||||||||||
| 1635 | - | |||||||||||||||||||||||||||||||
| 1636 | - | |||||||||||||||||||||||||||||||
| 1637 | - | |||||||||||||||||||||||||||||||
| 1638 | - | |||||||||||||||||||||||||||||||
| 1639 | - | |||||||||||||||||||||||||||||||
| 1640 | - | |||||||||||||||||||||||||||||||
| 1641 | if ((
| 81-560662 | ||||||||||||||||||||||||||||||
| 1642 | if (stat(p->fts_accpath, sbp)
| 47-861 | ||||||||||||||||||||||||||||||
| 1643 | if ( | - | ||||||||||||||||||||||||||||||
| 1644 | (*
| 3-44 | ||||||||||||||||||||||||||||||
| 1645 | ==
| 3-44 | ||||||||||||||||||||||||||||||
| 1646 | 2
| 3-44 | ||||||||||||||||||||||||||||||
| 1647 | - | |||||||||||||||||||||||||||||||
| 1648 | && lstat(p->fts_accpath, sbp) == 0
| 2-42 | ||||||||||||||||||||||||||||||
| 1649 | - | |||||||||||||||||||||||||||||||
| 1650 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1651 | = (0); | - | ||||||||||||||||||||||||||||||
| 1652 | return executed 2 times by 2 tests: (13);return (13);Executed by:
executed 2 times by 2 tests: return (13);Executed by:
| 2 | ||||||||||||||||||||||||||||||
| 1653 | } | - | ||||||||||||||||||||||||||||||
| 1654 | p->fts_errno = | - | ||||||||||||||||||||||||||||||
| 1655 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1656 | ; | - | ||||||||||||||||||||||||||||||
| 1657 | goto executed 45 times by 2 tests: err;goto err;Executed by:
executed 45 times by 2 tests: goto err;Executed by:
| 45 | ||||||||||||||||||||||||||||||
| 1658 | } | - | ||||||||||||||||||||||||||||||
| 1659 | } executed 861 times by 4 tests: else if (fstatat(sp->fts_cwd_fd, p->fts_accpath, sbp,end of blockExecuted by:
| 508-559327 | ||||||||||||||||||||||||||||||
| 1660 |
| 508-559327 | ||||||||||||||||||||||||||||||
| 1661 | 0x100
| 508-559327 | ||||||||||||||||||||||||||||||
| 1662 | )
| 508-559327 | ||||||||||||||||||||||||||||||
| 1663 | p->fts_errno = | - | ||||||||||||||||||||||||||||||
| 1664 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1665 | ; | - | ||||||||||||||||||||||||||||||
| 1666 | err: code before this statement executed 508 times by 5 tests: memset(sbp, 0, sizeof(struct stat));err:Executed by:
| 508 | ||||||||||||||||||||||||||||||
| 1667 | return executed 553 times by 5 tests: (10);return (10);Executed by:
executed 553 times by 5 tests: return (10);Executed by:
| 553 | ||||||||||||||||||||||||||||||
| 1668 | } | - | ||||||||||||||||||||||||||||||
| 1669 | - | |||||||||||||||||||||||||||||||
| 1670 | if ( | - | ||||||||||||||||||||||||||||||
| 1671 | ((((
| 102144-458044 | ||||||||||||||||||||||||||||||
| 1672 | sbp->st_mode
| 102144-458044 | ||||||||||||||||||||||||||||||
| 1673 | )) & 0170000) == (0040000))
| 102144-458044 | ||||||||||||||||||||||||||||||
| 1674 | ) { | - | ||||||||||||||||||||||||||||||
| 1675 | p->fts_n_dirs_remaining | - | ||||||||||||||||||||||||||||||
| 1676 | = ((sbp->st_nlink < MIN_DIR_NLINK
| 0-102144 | ||||||||||||||||||||||||||||||
| 1677 | || p->fts_level <= 0
| 5336-96808 | ||||||||||||||||||||||||||||||
| 1678 | ? -1 | - | ||||||||||||||||||||||||||||||
| 1679 | : sbp->st_nlink - ((
| 0-96808 | ||||||||||||||||||||||||||||||
| 1680 | if ((p->fts_name[0] == '.'
| 0-102106 | ||||||||||||||||||||||||||||||
| 1681 | - | |||||||||||||||||||||||||||||||
| 1682 | return executed 38 times by 3 tests: (p->fts_level == 0 ? 1 : 5);return (p->fts_level == 0 ? 1 : 5);Executed by:
executed 38 times by 3 tests: return (p->fts_level == 0 ? 1 : 5);Executed by:
| 38 | ||||||||||||||||||||||||||||||
| 1683 | } | - | ||||||||||||||||||||||||||||||
| 1684 | - | |||||||||||||||||||||||||||||||
| 1685 | return executed 102106 times by 6 tests: (1);return (1);Executed by:
executed 102106 times by 6 tests: return (1);Executed by:
| 102106 | ||||||||||||||||||||||||||||||
| 1686 | } | - | ||||||||||||||||||||||||||||||
| 1687 | if ( | - | ||||||||||||||||||||||||||||||
| 1688 | ((((
| 583-457461 | ||||||||||||||||||||||||||||||
| 1689 | sbp->st_mode
| 583-457461 | ||||||||||||||||||||||||||||||
| 1690 | )) & 0170000) == (0120000))
| 583-457461 | ||||||||||||||||||||||||||||||
| 1691 | ) | - | ||||||||||||||||||||||||||||||
| 1692 | return executed 583 times by 6 tests: (12);return (12);Executed by:
executed 583 times by 6 tests: return (12);Executed by:
| 583 | ||||||||||||||||||||||||||||||
| 1693 | if ( | - | ||||||||||||||||||||||||||||||
| 1694 | ((((
| 27-457434 | ||||||||||||||||||||||||||||||
| 1695 | sbp->st_mode
| 27-457434 | ||||||||||||||||||||||||||||||
| 1696 | )) & 0170000) == (0100000))
| 27-457434 | ||||||||||||||||||||||||||||||
| 1697 | ) | - | ||||||||||||||||||||||||||||||
| 1698 | return executed 457434 times by 6 tests: (8);return (8);Executed by:
executed 457434 times by 6 tests: return (8);Executed by:
| 457434 | ||||||||||||||||||||||||||||||
| 1699 | return executed 27 times by 3 tests: (3);return (3);Executed by:
executed 27 times by 3 tests: return (3);Executed by:
| 27 | ||||||||||||||||||||||||||||||
| 1700 | } | - | ||||||||||||||||||||||||||||||
| 1701 | - | |||||||||||||||||||||||||||||||
| 1702 | static int | - | ||||||||||||||||||||||||||||||
| 1703 | fts_compar (void const *a, void const *b) | - | ||||||||||||||||||||||||||||||
| 1704 | { | - | ||||||||||||||||||||||||||||||
| 1705 | - | |||||||||||||||||||||||||||||||
| 1706 | - | |||||||||||||||||||||||||||||||
| 1707 | - | |||||||||||||||||||||||||||||||
| 1708 | - | |||||||||||||||||||||||||||||||
| 1709 | - | |||||||||||||||||||||||||||||||
| 1710 | FTSENT const **pa = (FTSENT const **) a; | - | ||||||||||||||||||||||||||||||
| 1711 | FTSENT const **pb = (FTSENT const **) b; | - | ||||||||||||||||||||||||||||||
| 1712 | return never executed: pa[0]->fts_fts->fts_compar (pa, pb);return pa[0]->fts_fts->fts_compar (pa, pb);never executed: return pa[0]->fts_fts->fts_compar (pa, pb); | 0 | ||||||||||||||||||||||||||||||
| 1713 | } | - | ||||||||||||||||||||||||||||||
| 1714 | - | |||||||||||||||||||||||||||||||
| 1715 | static FTSENT * | - | ||||||||||||||||||||||||||||||
| 1716 | - | |||||||||||||||||||||||||||||||
| 1717 | fts_sort (FTS *sp, FTSENT *head, register size_t nitems) | - | ||||||||||||||||||||||||||||||
| 1718 | { | - | ||||||||||||||||||||||||||||||
| 1719 | register FTSENT **ap, *p; | - | ||||||||||||||||||||||||||||||
| 1720 | FTSENT *dummy; | - | ||||||||||||||||||||||||||||||
| 1721 | int (*compare) (void const *, void const *) = | - | ||||||||||||||||||||||||||||||
| 1722 | ((sizeof &dummy == sizeof (void *)
| 0-14 | ||||||||||||||||||||||||||||||
| 1723 | && (
| 0-14 | ||||||||||||||||||||||||||||||
| 1724 | ? (int (*) (void const *, void const *)) sp->fts_compar | - | ||||||||||||||||||||||||||||||
| 1725 | : fts_compar); | - | ||||||||||||||||||||||||||||||
| 1726 | if (nitems > sp->fts_nitems
| 5-9 | ||||||||||||||||||||||||||||||
| 1727 | FTSENT **a; | - | ||||||||||||||||||||||||||||||
| 1728 | - | |||||||||||||||||||||||||||||||
| 1729 | sp->fts_nitems = nitems + 40; | - | ||||||||||||||||||||||||||||||
| 1730 | if ( | - | ||||||||||||||||||||||||||||||
| 1731 | (
| 0-5 | ||||||||||||||||||||||||||||||
| 1732 | / sizeof *a < sp->fts_nitems
| 0-5 | ||||||||||||||||||||||||||||||
| 1733 | || ! (a = realloc (sp->fts_array,
| 0-5 | ||||||||||||||||||||||||||||||
| 1734 | sp->fts_nitems * sizeof *a))
| 0-5 | ||||||||||||||||||||||||||||||
| 1735 | free(sp->fts_array); | - | ||||||||||||||||||||||||||||||
| 1736 | sp->fts_array = | - | ||||||||||||||||||||||||||||||
| 1737 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1738 | ; | - | ||||||||||||||||||||||||||||||
| 1739 | sp->fts_nitems = 0; | - | ||||||||||||||||||||||||||||||
| 1740 | return never executed: (head);return (head);never executed: return (head); | 0 | ||||||||||||||||||||||||||||||
| 1741 | } | - | ||||||||||||||||||||||||||||||
| 1742 | sp->fts_array = a; | - | ||||||||||||||||||||||||||||||
| 1743 | } executed 5 times by 3 tests: end of blockExecuted by:
| 5 | ||||||||||||||||||||||||||||||
| 1744 | for (ap = sp->fts_array, p = head; p
| 14-760000 | ||||||||||||||||||||||||||||||
| 1745 | * executed 760000 times by 3 tests: ap++ = p;*ap++ = p;Executed by:
executed 760000 times by 3 tests: *ap++ = p;Executed by:
| 760000 | ||||||||||||||||||||||||||||||
| 1746 | qsort((void *)sp->fts_array, nitems, sizeof(FTSENT *), compare); | - | ||||||||||||||||||||||||||||||
| 1747 | for (head = *(ap = sp->fts_array); --
| 14-759986 | ||||||||||||||||||||||||||||||
| 1748 | ap[0]->fts_link = ap[1]; executed 759986 times by 3 tests: ap[0]->fts_link = ap[1];Executed by:
| 759986 | ||||||||||||||||||||||||||||||
| 1749 | ap[0]->fts_link = | - | ||||||||||||||||||||||||||||||
| 1750 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1751 | ; | - | ||||||||||||||||||||||||||||||
| 1752 | return executed 14 times by 3 tests: (head);return (head);Executed by:
executed 14 times by 3 tests: return (head);Executed by:
| 14 | ||||||||||||||||||||||||||||||
| 1753 | } | - | ||||||||||||||||||||||||||||||
| 1754 | - | |||||||||||||||||||||||||||||||
| 1755 | static FTSENT * | - | ||||||||||||||||||||||||||||||
| 1756 | - | |||||||||||||||||||||||||||||||
| 1757 | fts_alloc (FTS *sp, const char *name, register size_t namelen) | - | ||||||||||||||||||||||||||||||
| 1758 | { | - | ||||||||||||||||||||||||||||||
| 1759 | register FTSENT *p; | - | ||||||||||||||||||||||||||||||
| 1760 | size_t len; | - | ||||||||||||||||||||||||||||||
| 1761 | - | |||||||||||||||||||||||||||||||
| 1762 | - | |||||||||||||||||||||||||||||||
| 1763 | - | |||||||||||||||||||||||||||||||
| 1764 | - | |||||||||||||||||||||||||||||||
| 1765 | - | |||||||||||||||||||||||||||||||
| 1766 | len = (( | - | ||||||||||||||||||||||||||||||
| 1767 | __builtin_offsetof ( | - | ||||||||||||||||||||||||||||||
| 1768 | FTSENT | - | ||||||||||||||||||||||||||||||
| 1769 | , | - | ||||||||||||||||||||||||||||||
| 1770 | fts_name | - | ||||||||||||||||||||||||||||||
| 1771 | ) | - | ||||||||||||||||||||||||||||||
| 1772 | + _Alignof (FTSENT) - 1 + (namelen + 1)) & ~ (_Alignof (FTSENT) - 1)); | - | ||||||||||||||||||||||||||||||
| 1773 | if ((
| 0-822252 | ||||||||||||||||||||||||||||||
| 1774 | ((void *)0)
| 0-822252 | ||||||||||||||||||||||||||||||
| 1775 | ) | - | ||||||||||||||||||||||||||||||
| 1776 | return never executed: (return ( ((void *)0) );never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1777 | ((void *)0) never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1778 | ); never executed: return ( ((void *)0) ); | 0 | ||||||||||||||||||||||||||||||
| 1779 | - | |||||||||||||||||||||||||||||||
| 1780 | - | |||||||||||||||||||||||||||||||
| 1781 | memcpy(p->fts_name, name, namelen); | - | ||||||||||||||||||||||||||||||
| 1782 | p->fts_name[namelen] = '\0'; | - | ||||||||||||||||||||||||||||||
| 1783 | - | |||||||||||||||||||||||||||||||
| 1784 | p->fts_namelen = namelen; | - | ||||||||||||||||||||||||||||||
| 1785 | p->fts_fts = sp; | - | ||||||||||||||||||||||||||||||
| 1786 | p->fts_path = sp->fts_path; | - | ||||||||||||||||||||||||||||||
| 1787 | p->fts_errno = 0; | - | ||||||||||||||||||||||||||||||
| 1788 | p->fts_dirp = | - | ||||||||||||||||||||||||||||||
| 1789 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1790 | ; | - | ||||||||||||||||||||||||||||||
| 1791 | p->fts_flags = 0; | - | ||||||||||||||||||||||||||||||
| 1792 | p->fts_instr = 3; | - | ||||||||||||||||||||||||||||||
| 1793 | p->fts_number = 0; | - | ||||||||||||||||||||||||||||||
| 1794 | p->fts_pointer = | - | ||||||||||||||||||||||||||||||
| 1795 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1796 | ; | - | ||||||||||||||||||||||||||||||
| 1797 | return executed 822252 times by 6 tests: (p);return (p);Executed by:
executed 822252 times by 6 tests: return (p);Executed by:
| 822252 | ||||||||||||||||||||||||||||||
| 1798 | } | - | ||||||||||||||||||||||||||||||
| 1799 | - | |||||||||||||||||||||||||||||||
| 1800 | static void | - | ||||||||||||||||||||||||||||||
| 1801 | - | |||||||||||||||||||||||||||||||
| 1802 | fts_lfree (register FTSENT *head) | - | ||||||||||||||||||||||||||||||
| 1803 | { | - | ||||||||||||||||||||||||||||||
| 1804 | register FTSENT *p; | - | ||||||||||||||||||||||||||||||
| 1805 | - | |||||||||||||||||||||||||||||||
| 1806 | - | |||||||||||||||||||||||||||||||
| 1807 | while ((
| 0-40632 | ||||||||||||||||||||||||||||||
| 1808 | head = head->fts_link; | - | ||||||||||||||||||||||||||||||
| 1809 | if (p->fts_dirp
| 0 | ||||||||||||||||||||||||||||||
| 1810 | closedir (p->fts_dirp); never executed: closedir (p->fts_dirp); | 0 | ||||||||||||||||||||||||||||||
| 1811 | free(p); | - | ||||||||||||||||||||||||||||||
| 1812 | } never executed: end of block | 0 | ||||||||||||||||||||||||||||||
| 1813 | } executed 40632 times by 3 tests: end of blockExecuted by:
| 40632 | ||||||||||||||||||||||||||||||
| 1814 | static | - | ||||||||||||||||||||||||||||||
| 1815 | _Bool | - | ||||||||||||||||||||||||||||||
| 1816 | - | |||||||||||||||||||||||||||||||
| 1817 | - | |||||||||||||||||||||||||||||||
| 1818 | fts_palloc (FTS *sp, size_t more) | - | ||||||||||||||||||||||||||||||
| 1819 | { | - | ||||||||||||||||||||||||||||||
| 1820 | char *p; | - | ||||||||||||||||||||||||||||||
| 1821 | size_t new_len = sp->fts_pathlen + more + 256; | - | ||||||||||||||||||||||||||||||
| 1822 | - | |||||||||||||||||||||||||||||||
| 1823 | - | |||||||||||||||||||||||||||||||
| 1824 | - | |||||||||||||||||||||||||||||||
| 1825 | - | |||||||||||||||||||||||||||||||
| 1826 | if (new_len < sp->fts_pathlen
| 0-6827 | ||||||||||||||||||||||||||||||
| 1827 | free(sp->fts_path); | - | ||||||||||||||||||||||||||||||
| 1828 | sp->fts_path = | - | ||||||||||||||||||||||||||||||
| 1829 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1830 | ; | - | ||||||||||||||||||||||||||||||
| 1831 | - | |||||||||||||||||||||||||||||||
| 1832 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 1833 | = ( | - | ||||||||||||||||||||||||||||||
| 1834 | 36 | - | ||||||||||||||||||||||||||||||
| 1835 | ); | - | ||||||||||||||||||||||||||||||
| 1836 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||
| 1837 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||
| 1838 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||
| 1839 | } | - | ||||||||||||||||||||||||||||||
| 1840 | sp->fts_pathlen = new_len; | - | ||||||||||||||||||||||||||||||
| 1841 | p = realloc(sp->fts_path, sp->fts_pathlen); | - | ||||||||||||||||||||||||||||||
| 1842 | if (p ==
| 0-6827 | ||||||||||||||||||||||||||||||
| 1843 | ((void *)0)
| 0-6827 | ||||||||||||||||||||||||||||||
| 1844 | ) { | - | ||||||||||||||||||||||||||||||
| 1845 | free(sp->fts_path); | - | ||||||||||||||||||||||||||||||
| 1846 | sp->fts_path = | - | ||||||||||||||||||||||||||||||
| 1847 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 1848 | ; | - | ||||||||||||||||||||||||||||||
| 1849 | return never executed: return 0 ;never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||
| 1850 | 0 never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||
| 1851 | ; never executed: return 0 ; | 0 | ||||||||||||||||||||||||||||||
| 1852 | } | - | ||||||||||||||||||||||||||||||
| 1853 | sp->fts_path = p; | - | ||||||||||||||||||||||||||||||
| 1854 | return executed 6827 times by 6 tests: return 1 ;Executed by:
executed 6827 times by 6 tests: return 1 ;Executed by:
| 6827 | ||||||||||||||||||||||||||||||
| 1855 | 1 executed 6827 times by 6 tests: return 1 ;Executed by:
| 6827 | ||||||||||||||||||||||||||||||
| 1856 | ; executed 6827 times by 6 tests: return 1 ;Executed by:
| 6827 | ||||||||||||||||||||||||||||||
| 1857 | } | - | ||||||||||||||||||||||||||||||
| 1858 | - | |||||||||||||||||||||||||||||||
| 1859 | - | |||||||||||||||||||||||||||||||
| 1860 | - | |||||||||||||||||||||||||||||||
| 1861 | - | |||||||||||||||||||||||||||||||
| 1862 | - | |||||||||||||||||||||||||||||||
| 1863 | static void | - | ||||||||||||||||||||||||||||||
| 1864 | - | |||||||||||||||||||||||||||||||
| 1865 | fts_padjust (FTS *sp, FTSENT *head) | - | ||||||||||||||||||||||||||||||
| 1866 | { | - | ||||||||||||||||||||||||||||||
| 1867 | FTSENT *p; | - | ||||||||||||||||||||||||||||||
| 1868 | char *addr = sp->fts_path; | - | ||||||||||||||||||||||||||||||
| 1869 | for (p = sp->fts_child; p
| 0-7 | ||||||||||||||||||||||||||||||
| 1870 | do { if ((
never executed: (p)->fts_path = addr; }end of blocknever executed: while (0);end of block | 0 | ||||||||||||||||||||||||||||||
| 1871 | - | |||||||||||||||||||||||||||||||
| 1872 | - | |||||||||||||||||||||||||||||||
| 1873 | for (p = head; p->fts_level >= 0
| 7-340 | ||||||||||||||||||||||||||||||
| 1874 | do { if ((
executed 7 times by 3 tests: (p)->fts_path = addr; } while (0);end of blockExecuted by:
| 7-333 | ||||||||||||||||||||||||||||||
| 1875 | p = p->fts_link
| 0-340 | ||||||||||||||||||||||||||||||
| 1876 | } executed 340 times by 3 tests: end of blockExecuted by:
| 340 | ||||||||||||||||||||||||||||||
| 1877 | } executed 7 times by 3 tests: end of blockExecuted by:
| 7 | ||||||||||||||||||||||||||||||
| 1878 | - | |||||||||||||||||||||||||||||||
| 1879 | static size_t | - | ||||||||||||||||||||||||||||||
| 1880 | - | |||||||||||||||||||||||||||||||
| 1881 | __attribute__ ((__pure__)) | - | ||||||||||||||||||||||||||||||
| 1882 | - | |||||||||||||||||||||||||||||||
| 1883 | fts_maxarglen (char * const *argv) | - | ||||||||||||||||||||||||||||||
| 1884 | { | - | ||||||||||||||||||||||||||||||
| 1885 | size_t len, max; | - | ||||||||||||||||||||||||||||||
| 1886 | - | |||||||||||||||||||||||||||||||
| 1887 | for (max = 0; *
| 6820-7918 | ||||||||||||||||||||||||||||||
| 1888 | if ((
| 725-7193 | ||||||||||||||||||||||||||||||
| 1889 | max = len; executed 7193 times by 6 tests: max = len;Executed by:
| 7193 | ||||||||||||||||||||||||||||||
| 1890 | return executed 6820 times by 6 tests: (max + 1);return (max + 1);Executed by:
executed 6820 times by 6 tests: return (max + 1);Executed by:
| 6820 | ||||||||||||||||||||||||||||||
| 1891 | } | - | ||||||||||||||||||||||||||||||
| 1892 | static int | - | ||||||||||||||||||||||||||||||
| 1893 | - | |||||||||||||||||||||||||||||||
| 1894 | fts_safe_changedir (FTS *sp, FTSENT *p, int fd, char const *dir) | - | ||||||||||||||||||||||||||||||
| 1895 | { | - | ||||||||||||||||||||||||||||||
| 1896 | int ret; | - | ||||||||||||||||||||||||||||||
| 1897 | - | |||||||||||||||||||||||||||||||
| 1898 | _Bool | - | ||||||||||||||||||||||||||||||
| 1899 | is_dotdot = dir
| 0-61084 | ||||||||||||||||||||||||||||||
| 1900 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1901 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1902 | ) && __builtin_constant_p (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1903 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1904 | ) && (__s1_len = __builtin_strlen (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1905 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1906 | ), __s2_len = __builtin_strlen (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1907 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1908 | ), (!((size_t)(const void *)((
| 0-56225 | ||||||||||||||||||||||||||||||
| 1909 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1910 | ) + 1) - (size_t)(const void *)(
| 0-56225 | ||||||||||||||||||||||||||||||
| 1911 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1912 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 0-56225 | ||||||||||||||||||||||||||||||
| 1913 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1914 | ) + 1) - (size_t)(const void *)(
| 0-56225 | ||||||||||||||||||||||||||||||
| 1915 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1916 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1917 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1918 | ,
| 0-56225 | ||||||||||||||||||||||||||||||
| 1919 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1920 | ) : (__builtin_constant_p (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1921 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1922 | ) && ((size_t)(const void *)((
| 0-56225 | ||||||||||||||||||||||||||||||
| 1923 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1924 | ) + 1) - (size_t)(const void *)(
| 0-56225 | ||||||||||||||||||||||||||||||
| 1925 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1926 | ) == 1) && (__s1_len = __builtin_strlen (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1927 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1928 | ), __s1_len < 4) ? (__builtin_constant_p (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1929 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1930 | ) && ((size_t)(const void *)((
| 0-56225 | ||||||||||||||||||||||||||||||
| 1931 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1932 | ) + 1) - (size_t)(const void *)(
| 0-56225 | ||||||||||||||||||||||||||||||
| 1933 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1934 | ) == 1) ? __builtin_strcmp (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1935 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1936 | ,
| 0-56225 | ||||||||||||||||||||||||||||||
| 1937 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1938 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1939 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1940 | ); int __result = (((const unsigned char *) (const char *) (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1941 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1942 | ))[0] - __s2[0]); if (__s1_len > 0
| 0-56225 | ||||||||||||||||||||||||||||||
| 1943 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1944 | ))[1] - __s2[1]); if (__s1_len > 1
| 0-56225 | ||||||||||||||||||||||||||||||
| 1945 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1946 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( dir ))[3] - __s2[3]);
| 0-56225 | ||||||||||||||||||||||||||||||
| 1947 | dir
never executed: __result = (((const unsigned char *) (const char *) ( dir ))[3] - __s2[3]); | 0-56225 | ||||||||||||||||||||||||||||||
| 1948 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( dir ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : (__builtin_constant_p (end of block
| 0-56225 | ||||||||||||||||||||||||||||||
| 1949 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1950 | ) && ((size_t)(const void *)((
| 0-56225 | ||||||||||||||||||||||||||||||
| 1951 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1952 | ) + 1) - (size_t)(const void *)(
| 0-56225 | ||||||||||||||||||||||||||||||
| 1953 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1954 | ) == 1) && (__s2_len = __builtin_strlen (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1955 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1956 | ), __s2_len < 4) ? (__builtin_constant_p (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1957 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1958 | ) && ((size_t)(const void *)((
| 0-56225 | ||||||||||||||||||||||||||||||
| 1959 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1960 | ) + 1) - (size_t)(const void *)(
| 0-56225 | ||||||||||||||||||||||||||||||
| 1961 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1962 | ) == 1) ? __builtin_strcmp (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1963 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1964 | ,
| 0-56225 | ||||||||||||||||||||||||||||||
| 1965 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1966 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1967 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1968 | ); int __result = (((const unsigned char *) (const char *) (
| 0-56225 | ||||||||||||||||||||||||||||||
| 1969 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1970 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-56225 | ||||||||||||||||||||||||||||||
| 1971 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1972 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-56225 | ||||||||||||||||||||||||||||||
| 1973 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1974 | ))[2] - __s2[2]); if (__s2_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( ".." ))[3] - __s2[3]);
| 0-56225 | ||||||||||||||||||||||||||||||
| 1975 | ".."
never executed: __result = (((const unsigned char *) (const char *) ( ".." ))[3] - __s2[3]); | 0-56225 | ||||||||||||||||||||||||||||||
| 1976 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( ".." ))[3] - __s2[3]);executed 56225 times by 5 tests: }end of blockExecuted by:
executed 56225 times by 5 tests: __result; }))) : __builtin_strcmp (end of blockExecuted by:
| 0-56225 | ||||||||||||||||||||||||||||||
| 1977 | dir
| 0-56225 | ||||||||||||||||||||||||||||||
| 1978 | ,
| 0-56225 | ||||||||||||||||||||||||||||||
| 1979 | ".."
| 0-56225 | ||||||||||||||||||||||||||||||
| 1980 | )))); })
| 0-56225 | ||||||||||||||||||||||||||||||
| 1981 | == 0)
| 0-56225 | ||||||||||||||||||||||||||||||
| 1982 | int newfd; | - | ||||||||||||||||||||||||||||||
| 1983 | - | |||||||||||||||||||||||||||||||
| 1984 | - | |||||||||||||||||||||||||||||||
| 1985 | - | |||||||||||||||||||||||||||||||
| 1986 | - | |||||||||||||||||||||||||||||||
| 1987 | - | |||||||||||||||||||||||||||||||
| 1988 | if ((
| 101-117208 | ||||||||||||||||||||||||||||||
| 1989 | { | - | ||||||||||||||||||||||||||||||
| 1990 | if ((
| 0-101 | ||||||||||||||||||||||||||||||
| 1991 | close (fd); never executed: close (fd); | 0 | ||||||||||||||||||||||||||||||
| 1992 | return executed 101 times by 3 tests: 0;return 0;Executed by:
executed 101 times by 3 tests: return 0;Executed by:
| 101 | ||||||||||||||||||||||||||||||
| 1993 | } | - | ||||||||||||||||||||||||||||||
| 1994 | - | |||||||||||||||||||||||||||||||
| 1995 | if (fd < 0
| 0-61028 | ||||||||||||||||||||||||||||||
| 1996 | { | - | ||||||||||||||||||||||||||||||
| 1997 | - | |||||||||||||||||||||||||||||||
| 1998 | - | |||||||||||||||||||||||||||||||
| 1999 | - | |||||||||||||||||||||||||||||||
| 2000 | - | |||||||||||||||||||||||||||||||
| 2001 | - | |||||||||||||||||||||||||||||||
| 2002 | if ( ! i_ring_empty (&sp->fts_fd_ring)
| 14191-41989 | ||||||||||||||||||||||||||||||
| 2003 | { | - | ||||||||||||||||||||||||||||||
| 2004 | int parent_fd; | - | ||||||||||||||||||||||||||||||
| 2005 | ; | - | ||||||||||||||||||||||||||||||
| 2006 | parent_fd = i_ring_pop (&sp->fts_fd_ring); | - | ||||||||||||||||||||||||||||||
| 2007 | is_dotdot = | - | ||||||||||||||||||||||||||||||
| 2008 | 1 | - | ||||||||||||||||||||||||||||||
| 2009 | ; | - | ||||||||||||||||||||||||||||||
| 2010 | if (0 <= parent_fd
| 0-41989 | ||||||||||||||||||||||||||||||
| 2011 | { | - | ||||||||||||||||||||||||||||||
| 2012 | fd = parent_fd; | - | ||||||||||||||||||||||||||||||
| 2013 | dir = | - | ||||||||||||||||||||||||||||||
| 2014 | ((void *)0) | - | ||||||||||||||||||||||||||||||
| 2015 | ; | - | ||||||||||||||||||||||||||||||
| 2016 | } executed 41989 times by 5 tests: end of blockExecuted by:
| 41989 | ||||||||||||||||||||||||||||||
| 2017 | } executed 41989 times by 5 tests: end of blockExecuted by:
| 41989 | ||||||||||||||||||||||||||||||
| 2018 | } executed 56180 times by 5 tests: end of blockExecuted by:
| 56180 | ||||||||||||||||||||||||||||||
| 2019 | - | |||||||||||||||||||||||||||||||
| 2020 | newfd = fd; | - | ||||||||||||||||||||||||||||||
| 2021 | if (fd < 0
| 0-103017 | ||||||||||||||||||||||||||||||
| 2022 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||||||||
| 2023 | if ((
| 0-117208 | ||||||||||||||||||||||||||||||
| 2024 | || (dir
| 0-103017 | ||||||||||||||||||||||||||||||
| 2025 | __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2026 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2027 | ) && __builtin_constant_p (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2028 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2029 | ) && (__s1_len = __builtin_strlen (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2030 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2031 | ), __s2_len = __builtin_strlen (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2032 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2033 | ), (!((size_t)(const void *)((
| 0-14191 | ||||||||||||||||||||||||||||||
| 2034 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2035 | ) + 1) - (size_t)(const void *)(
| 0-14191 | ||||||||||||||||||||||||||||||
| 2036 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2037 | ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
| 0-14191 | ||||||||||||||||||||||||||||||
| 2038 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2039 | ) + 1) - (size_t)(const void *)(
| 0-14191 | ||||||||||||||||||||||||||||||
| 2040 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2041 | ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2042 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2043 | ,
| 0-14191 | ||||||||||||||||||||||||||||||
| 2044 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2045 | ) : (__builtin_constant_p (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2046 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2047 | ) && ((size_t)(const void *)((
| 0-14191 | ||||||||||||||||||||||||||||||
| 2048 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2049 | ) + 1) - (size_t)(const void *)(
| 0-14191 | ||||||||||||||||||||||||||||||
| 2050 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2051 | ) == 1) && (__s1_len = __builtin_strlen (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2052 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2053 | ), __s1_len < 4) ? (__builtin_constant_p (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2054 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2055 | ) && ((size_t)(const void *)((
| 0-14191 | ||||||||||||||||||||||||||||||
| 2056 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2057 | ) + 1) - (size_t)(const void *)(
| 0-14191 | ||||||||||||||||||||||||||||||
| 2058 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2059 | ) == 1) ? __builtin_strcmp (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2060 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2061 | ,
| 0-14191 | ||||||||||||||||||||||||||||||
| 2062 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2063 | ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2064 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2065 | ); int __result = (((const unsigned char *) (const char *) (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2066 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2067 | ))[0] - __s2[0]); if (__s1_len > 0
| 0-14191 | ||||||||||||||||||||||||||||||
| 2068 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2069 | ))[1] - __s2[1]); if (__s1_len > 1
| 0-14191 | ||||||||||||||||||||||||||||||
| 2070 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2071 | ))[2] - __s2[2]); if (__s1_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( dir ))[3] - __s2[3]);
| 0-14191 | ||||||||||||||||||||||||||||||
| 2072 | dir
never executed: __result = (((const unsigned char *) (const char *) ( dir ))[3] - __s2[3]); | 0-14191 | ||||||||||||||||||||||||||||||
| 2073 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( dir ))[3] - __s2[3]);never executed: }end of blocknever executed: __result; }))) : (__builtin_constant_p (end of block
| 0-14191 | ||||||||||||||||||||||||||||||
| 2074 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2075 | ) && ((size_t)(const void *)((
| 0-14191 | ||||||||||||||||||||||||||||||
| 2076 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2077 | ) + 1) - (size_t)(const void *)(
| 0-14191 | ||||||||||||||||||||||||||||||
| 2078 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2079 | ) == 1) && (__s2_len = __builtin_strlen (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2080 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2081 | ), __s2_len < 4) ? (__builtin_constant_p (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2082 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2083 | ) && ((size_t)(const void *)((
| 0-14191 | ||||||||||||||||||||||||||||||
| 2084 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2085 | ) + 1) - (size_t)(const void *)(
| 0-14191 | ||||||||||||||||||||||||||||||
| 2086 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2087 | ) == 1) ? __builtin_strcmp (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2088 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2089 | ,
| 0-14191 | ||||||||||||||||||||||||||||||
| 2090 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2091 | ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2092 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2093 | ); int __result = (((const unsigned char *) (const char *) (
| 0-14191 | ||||||||||||||||||||||||||||||
| 2094 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2095 | ))[0] - __s2[0]); if (__s2_len > 0
| 0-14191 | ||||||||||||||||||||||||||||||
| 2096 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2097 | ))[1] - __s2[1]); if (__s2_len > 1
| 0-14191 | ||||||||||||||||||||||||||||||
| 2098 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2099 | ))[2] - __s2[2]); if (__s2_len > 2
never executed: __result = (((const unsigned char *) (const char *) ( ".." ))[3] - __s2[3]);
| 0-14191 | ||||||||||||||||||||||||||||||
| 2100 | ".."
never executed: __result = (((const unsigned char *) (const char *) ( ".." ))[3] - __s2[3]); | 0-14191 | ||||||||||||||||||||||||||||||
| 2101 | ))[3] - __s2[3]);
never executed: }__result = (((const unsigned char *) (const char *) ( ".." ))[3] - __s2[3]);executed 14191 times by 3 tests: }end of blockExecuted by:
executed 14191 times by 3 tests: __result; }))) : __builtin_strcmp (end of blockExecuted by:
| 0-14191 | ||||||||||||||||||||||||||||||
| 2102 | dir
| 0-14191 | ||||||||||||||||||||||||||||||
| 2103 | ,
| 0-14191 | ||||||||||||||||||||||||||||||
| 2104 | ".."
| 0-14191 | ||||||||||||||||||||||||||||||
| 2105 | )))); })
| 0-14191 | ||||||||||||||||||||||||||||||
| 2106 | == 0)
| 0-14191 | ||||||||||||||||||||||||||||||
| 2107 | { | - | ||||||||||||||||||||||||||||||
| 2108 | struct stat sb; | - | ||||||||||||||||||||||||||||||
| 2109 | if (fstat(newfd, &sb)
| 0-14191 | ||||||||||||||||||||||||||||||
| 2110 | { | - | ||||||||||||||||||||||||||||||
| 2111 | ret = -1; | - | ||||||||||||||||||||||||||||||
| 2112 | goto never executed: bail;goto bail;never executed: goto bail; | 0 | ||||||||||||||||||||||||||||||
| 2113 | } | - | ||||||||||||||||||||||||||||||
| 2114 | if (p->fts_statp->st_dev != sb.st_dev
| 0-14191 | ||||||||||||||||||||||||||||||
| 2115 | || p->fts_statp->st_ino != sb.st_ino
| 1-14190 | ||||||||||||||||||||||||||||||
| 2116 | { | - | ||||||||||||||||||||||||||||||
| 2117 | - | |||||||||||||||||||||||||||||||
| 2118 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 2119 | = ( | - | ||||||||||||||||||||||||||||||
| 2120 | 2 | - | ||||||||||||||||||||||||||||||
| 2121 | ); | - | ||||||||||||||||||||||||||||||
| 2122 | ret = -1; | - | ||||||||||||||||||||||||||||||
| 2123 | goto executed 1 time by 1 test: bail;goto bail;Executed by:
executed 1 time by 1 test: goto bail;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 2124 | } | - | ||||||||||||||||||||||||||||||
| 2125 | } executed 14190 times by 3 tests: end of blockExecuted by:
| 14190 | ||||||||||||||||||||||||||||||
| 2126 | - | |||||||||||||||||||||||||||||||
| 2127 | if ((
| 0-117207 | ||||||||||||||||||||||||||||||
| 2128 | { | - | ||||||||||||||||||||||||||||||
| 2129 | cwd_advance_fd (sp, newfd, ! is_dotdot); | - | ||||||||||||||||||||||||||||||
| 2130 | return executed 117207 times by 6 tests: 0;return 0;Executed by:
executed 117207 times by 6 tests: return 0;Executed by:
| 117207 | ||||||||||||||||||||||||||||||
| 2131 | } | - | ||||||||||||||||||||||||||||||
| 2132 | - | |||||||||||||||||||||||||||||||
| 2133 | ret = fchdir(newfd); | - | ||||||||||||||||||||||||||||||
| 2134 | bail: code before this statement never executed: bail: | 0 | ||||||||||||||||||||||||||||||
| 2135 | if (fd < 0
| 0-1 | ||||||||||||||||||||||||||||||
| 2136 | { | - | ||||||||||||||||||||||||||||||
| 2137 | int oerrno = | - | ||||||||||||||||||||||||||||||
| 2138 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 2139 | ; | - | ||||||||||||||||||||||||||||||
| 2140 | (void)close(newfd); | - | ||||||||||||||||||||||||||||||
| 2141 | - | |||||||||||||||||||||||||||||||
| 2142 | (*__errno_location ()) | - | ||||||||||||||||||||||||||||||
| 2143 | = (oerrno); | - | ||||||||||||||||||||||||||||||
| 2144 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||||||||||||||
| 2145 | return executed 1 time by 1 test: ret;return ret;Executed by:
executed 1 time by 1 test: return ret;Executed by:
| 1 | ||||||||||||||||||||||||||||||
| 2146 | } | - | ||||||||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |