OpenCoverage

shred.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/shred.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8enum { DEFAULT_PASSES = 3 };-
9-
10-
11-
12enum { VERBOSE_UPDATE = 5 };-
13-
14-
15-
16enum { SECTOR_SIZE = 512 };-
17enum { SECTOR_MASK = SECTOR_SIZE - 1 };-
18_Static_assert (0 < SECTOR_SIZE && (SECTOR_SIZE & SECTOR_MASK) == 0, "verify (" "0 < SECTOR_SIZE && (SECTOR_SIZE & SECTOR_MASK) == 0" ")");-
19-
20enum remove_method-
21{-
22 remove_none = 0,-
23 remove_unlink,-
24 remove_wipe,-
25 remove_wipesync-
26};-
27-
28static char const *const remove_args[] =-
29{-
30 "unlink", "wipe", "wipesync", -
31 ((void *)0)-
32-
33};-
34-
35static enum remove_method const remove_methods[] =-
36{-
37 remove_unlink, remove_wipe, remove_wipesync-
38};-
39-
40struct Options-
41{-
42 -
43 _Bool -
44 force;-
45 size_t n_iterations;-
46 off_t size;-
47 enum remove_method remove_file;-
48 -
49 _Bool -
50 verbose;-
51 -
52 _Bool -
53 exact;-
54 -
55 _Bool -
56 zero_fill;-
57};-
58-
59-
60-
61enum-
62{-
63 RANDOM_SOURCE_OPTION = 0x7f + 1-
64};-
65-
66static struct option const long_opts[] =-
67{-
68 {"exact", -
69 0-
70 , -
71 ((void *)0)-
72 , 'x'},-
73 {"force", -
74 0-
75 , -
76 ((void *)0)-
77 , 'f'},-
78 {"iterations", -
79 1-
80 , -
81 ((void *)0)-
82 , 'n'},-
83 {"size", -
84 1-
85 , -
86 ((void *)0)-
87 , 's'},-
88 {"random-source", -
89 1-
90 , -
91 ((void *)0)-
92 , RANDOM_SOURCE_OPTION},-
93 {"remove", -
94 2-
95 , -
96 ((void *)0)-
97 , 'u'},-
98 {"verbose", -
99 0-
100 , -
101 ((void *)0)-
102 , 'v'},-
103 {"zero", -
104 0-
105 , -
106 ((void *)0)-
107 , 'z'},-
108 {"help", -
109 0-
110 , -
111 ((void *)0)-
112 , GETOPT_HELP_CHAR},-
113 {"version", -
114 0-
115 , -
116 ((void *)0)-
117 , GETOPT_VERSION_CHAR},-
118 {-
119 ((void *)0)-
120 , 0, -
121 ((void *)0)-
122 , 0}-
123};-
124-
125void-
126usage (int status)-
127{-
128 if (status !=
status != 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 14 times by 1 test
Evaluated by:
  • shred
4-14
129 0
status != 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 14 times by 1 test
Evaluated by:
  • shred
4-14
130 )-
131 do { fprintf (-
132 stderr-
133 , -
134 dcgettext (((void *)0), -
135 "Try '%s --help' for more information.\n"-
136 , 5)-
137 , program_name); }
executed 4 times by 1 test: end of block
Executed by:
  • shred
while (0);
4
138 else-
139 {-
140 printf (-
141 dcgettext (((void *)0), -
142 "Usage: %s [OPTION]... FILE...\n"-
143 , 5)-
144 , program_name);-
145 fputs_unlocked (-
146 dcgettext (((void *)0), -
147 "Overwrite the specified FILE(s) repeatedly, in order to make it harder\nfor even very expensive hardware probing to recover the data.\n"-
148 , 5)-
149 ,-
150 stdout-
151 )-
152-
153-
154 ;-
155 fputs_unlocked (-
156 dcgettext (((void *)0), -
157 "\nIf FILE is -, shred standard output.\n"-
158 , 5)-
159 ,-
160 stdout-
161 )-
162-
163-
164 ;-
165-
166 emit_mandatory_arg_note ();-
167-
168 printf (-
169 dcgettext (((void *)0), -
170 " -f, --force change permissions to allow writing if necessary\n -n, --iterations=N overwrite N times instead of the default (%d)\n --random-source=FILE get random bytes from FILE\n -s, --size=N shred this many bytes (suffixes like K, M, G accepted)\n"-
171 , 5)-
172-
173-
174-
175-
176 -
177 , DEFAULT_PASSES);-
178 fputs_unlocked (-
179 dcgettext (((void *)0), -
180 " -u deallocate and remove file after overwriting\n --remove[=HOW] like -u but give control on HOW to delete; See below\n -v, --verbose show progress\n -x, --exact do not round file sizes up to the next full block;\n this is the default for non-regular files\n -z, --zero add a final overwrite with zeros to hide shredding\n"-
181 , 5)-
182 ,-
183 stdout-
184 )-
185-
186-
187-
188-
189-
190-
191 ;-
192 fputs_unlocked (-
193 dcgettext (((void *)0), -
194 " --help display this help and exit\n"-
195 , 5)-
196 ,-
197 stdout-
198 );-
199 fputs_unlocked (-
200 dcgettext (((void *)0), -
201 " --version output version information and exit\n"-
202 , 5)-
203 ,-
204 stdout-
205 );-
206 fputs_unlocked (-
207 dcgettext (((void *)0), -
208 "\nDelete FILE(s) if --remove (-u) is specified. The default is not to remove\nthe files because it is common to operate on device files like /dev/hda,\nand those files usually should not be removed.\nThe optional HOW parameter indicates how to remove a directory entry:\n'unlink' => use a standard unlink call.\n'wipe' => also first obfuscate bytes in the name.\n'wipesync' => also sync each obfuscated byte to disk.\nThe default mode is 'wipesync', but note it can be expensive.\n\n"-
209 , 5)-
210 ,-
211 stdout-
212 )-
213 ;-
214 fputs_unlocked (-
215 dcgettext (((void *)0), -
216 "CAUTION: Note that shred relies on a very important assumption:\nthat the file system overwrites data in place. This is the traditional\nway to do things, but many modern file system designs do not satisfy this\nassumption. The following are examples of file systems on which shred is\nnot effective, or is not guaranteed to be effective in all file system modes:\n\n"-
217 , 5)-
218 ,-
219 stdout-
220 )-
221-
222-
223-
224-
225-
226-
227 ;-
228 fputs_unlocked (-
229 dcgettext (((void *)0), -
230 "* log-structured or journaled file systems, such as those supplied with\nAIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)\n\n* file systems that write redundant data and carry on even if some writes\nfail, such as RAID-based file systems\n\n* file systems that make snapshots, such as Network Appliance's NFS server\n\n"-
231 , 5)-
232 ,-
233 stdout-
234 )-
235 ;-
236 fputs_unlocked (-
237 dcgettext (((void *)0), -
238 "* file systems that cache in temporary locations, such as NFS\nversion 3 clients\n\n* compressed file systems\n\n"-
239 , 5)-
240 ,-
241 stdout-
242 )-
243-
244-
245-
246-
247-
248 ;-
249 fputs_unlocked (-
250 dcgettext (((void *)0), -
251 "In the case of ext3 file systems, the above disclaimer applies\n(and shred is thus of limited effectiveness) only in data=journal mode,\nwhich journals file data in addition to just metadata. In both the\ndata=ordered (default) and data=writeback modes, shred works as usual.\nExt3 journaling modes can be changed by adding the data=something option\nto the mount options for a particular file system in the /etc/fstab file,\nas documented in the mount man page (man mount).\n\n"-
252 , 5)-
253 ,-
254 stdout-
255 )-
256 ;-
257 fputs_unlocked (-
258 dcgettext (((void *)0), -
259 "In addition, file system backups and remote mirrors may contain copies\nof the file that cannot be removed, and that will allow a shredded file\nto be recovered later.\n"-
260 , 5)-
261 ,-
262 stdout-
263 )-
264-
265-
266-
267 ;-
268 emit_ancillary_info ("shred");-
269 }
executed 14 times by 1 test: end of block
Executed by:
  • shred
14
270 exit (status);
executed 18 times by 1 test: exit (status);
Executed by:
  • shred
18
271}-
272-
273-
274-
275-
276static -
277 _Bool-
278-
279periodic_pattern (int type)-
280{-
281 if (type <= 0
type <= 0Description
TRUEevaluated 96 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 41 times by 1 test
Evaluated by:
  • shred
)
41-96
282 return
executed 96 times by 1 test: return 0 ;
Executed by:
  • shred
executed 96 times by 1 test: return 0 ;
Executed by:
  • shred
96
283 0
executed 96 times by 1 test: return 0 ;
Executed by:
  • shred
96
284 ;
executed 96 times by 1 test: return 0 ;
Executed by:
  • shred
96
285-
286 unsigned char r[3];-
287 unsigned int bits = type & 0xfff;-
288-
289 bits |= bits << 12;-
290 r[0] = (bits >> 4) & 255;-
291 r[1] = (bits >> 8) & 255;-
292 r[2] = bits & 255;-
293-
294 return
executed 41 times by 1 test: return (r[0] != r[1]) || (r[0] != r[2]);
Executed by:
  • shred
(r[0] != r[1]) || (r[0] != r[2]);
executed 41 times by 1 test: return (r[0] != r[1]) || (r[0] != r[2]);
Executed by:
  • shred
41
295}-
296-
297-
298-
299-
300-
301-
302-
303static void-
304fillpattern (int type, unsigned char *r, size_t size)-
305{-
306 size_t i;-
307 unsigned int bits = type & 0xfff;-
308-
309 bits |= bits << 12;-
310 r[0] = (bits >> 4) & 255;-
311 r[1] = (bits >> 8) & 255;-
312 r[2] = bits & 255;-
313 for (i = 3; i <= size / 2
i <= size / 2Description
TRUEevaluated 210 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 58 times by 1 test
Evaluated by:
  • shred
; i *= 2)
58-210
314 memcpy (r + i, r, i);
executed 210 times by 1 test: memcpy (r + i, r, i);
Executed by:
  • shred
210
315 if (i < size
i < sizeDescription
TRUEevaluated 27 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 31 times by 1 test
Evaluated by:
  • shred
)
27-31
316 memcpy (r + i, r, size - i);
executed 27 times by 1 test: memcpy (r + i, r, size - i);
Executed by:
  • shred
27
317-
318-
319 if (type & 0x1000
type & 0x1000Description
TRUEnever evaluated
FALSEevaluated 58 times by 1 test
Evaluated by:
  • shred
)
0-58
320 for (i = 0; i < size
i < sizeDescription
TRUEnever evaluated
FALSEnever evaluated
; i += SECTOR_SIZE)
0
321 r[i] ^= 0x80;
never executed: r[i] ^= 0x80;
0
322}
executed 58 times by 1 test: end of block
Executed by:
  • shred
58
323-
324-
325-
326-
327-
328-
329static void-
330passname (unsigned char const *data, char name[7])-
331{-
332 if (data
dataDescription
TRUEevaluated 58 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 79 times by 1 test
Evaluated by:
  • shred
)
58-79
333 sprintf (name, "%02x%02x%02x", data[0], data[1], data[2]);
executed 58 times by 1 test: sprintf (name, "%02x%02x%02x", data[0], data[1], data[2]);
Executed by:
  • shred
58
334 else-
335 memcpy (name, "random", 7);
executed 79 times by 1 test: memcpy (name, "random", 7);
Executed by:
  • shred
79
336}-
337-
338-
339-
340static -
341 _Bool-
342-
343ignorable_sync_errno (int errno_val)-
344{-
345 return
never executed: return (errno_val == 22 || errno_val == 9 || errno_val == 21 );
(errno_val ==
never executed: return (errno_val == 22 || errno_val == 9 || errno_val == 21 );
0
346 22
never executed: return (errno_val == 22 || errno_val == 9 || errno_val == 21 );
0
347
never executed: return (errno_val == 22 || errno_val == 9 || errno_val == 21 );
0
348 || errno_val ==
never executed: return (errno_val == 22 || errno_val == 9 || errno_val == 21 );
0
349 9
never executed: return (errno_val == 22 || errno_val == 9 || errno_val == 21 );
0
3500
351
never executed: return (errno_val == 22 || errno_val == 9 || errno_val == 21 );
0
352 || errno_val ==
never executed: return (errno_val == 22 || errno_val == 9 || errno_val == 21 );
0
353 21
never executed: return (errno_val == 22 || errno_val == 9 || errno_val == 21 );
0
354 );
never executed: return (errno_val == 22 || errno_val == 9 || errno_val == 21 );
0
355}-
356-
357-
358-
359-
360-
361-
362-
363static int-
364dosync (int fd, char const *qname)-
365{-
366 int err;-
367-
368-
369 if (fdatasync (fd) == 0
fdatasync (fd) == 0Description
TRUEevaluated 182 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
)
0-182
370 return
executed 182 times by 1 test: return 0;
Executed by:
  • shred
0;
executed 182 times by 1 test: return 0;
Executed by:
  • shred
182
371 err = -
372 (*__errno_location ())-
373 ;-
374 if ( ! ignorable_sync_errno (err)
! ignorable_sync_errno (err)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
375 {-
376 error (0, err, -
377 dcgettext (((void *)0), -
378 "%s: fdatasync failed"-
379 , 5)-
380 , qname);-
381 -
382 (*__errno_location ()) -
383 = err;-
384 return
never executed: return -1;
-1;
never executed: return -1;
0
385 }-
386-
387-
388 if (fsync (fd) == 0
fsync (fd) == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
389 return
never executed: return 0;
0;
never executed: return 0;
0
390 err = -
391 (*__errno_location ())-
392 ;-
393 if ( ! ignorable_sync_errno (err)
! ignorable_sync_errno (err)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
394 {-
395 error (0, err, -
396 dcgettext (((void *)0), -
397 "%s: fsync failed"-
398 , 5)-
399 , qname);-
400 -
401 (*__errno_location ()) -
402 = err;-
403 return
never executed: return -1;
-1;
never executed: return -1;
0
404 }-
405-
406 sync ();-
407 return
never executed: return 0;
0;
never executed: return 0;
0
408}-
409-
410-
411-
412static void-
413direct_mode (int fd, -
414 _Bool -
415 enable)-
416{-
417 if (-
418 040000-
419 )-
420 {-
421 int fd_flags = -
422 rpl_fcntl -
423 (fd, -
424 3-
425 );-
426 if (0 < fd_flags
0 < fd_flagsDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
)
0-4
427 {-
428 int new_flags = (enable
enableDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 2 times by 1 test
Evaluated by:
  • shred
2
429 ? (fd_flags | -
430 040000-
431 )-
432 : (fd_flags & ~-
433 040000-
434 ));-
435 if (new_flags != fd_flags
new_flags != fd_flagsDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
)
0-4
436 -
437 rpl_fcntl
executed 4 times by 1 test: rpl_fcntl (fd, 4 , new_flags);
Executed by:
  • shred
4
438 (fd,
executed 4 times by 1 test: rpl_fcntl (fd, 4 , new_flags);
Executed by:
  • shred
4
439 4
executed 4 times by 1 test: rpl_fcntl (fd, 4 , new_flags);
Executed by:
  • shred
4
440 , new_flags);
executed 4 times by 1 test: rpl_fcntl (fd, 4 , new_flags);
Executed by:
  • shred
4
441 }
executed 4 times by 1 test: end of block
Executed by:
  • shred
4
442 }
executed 4 times by 1 test: end of block
Executed by:
  • shred
4
443-
444-
445-
446-
447-
448}-
449-
450-
451static -
452 _Bool-
453-
454dorewind (int fd, struct stat const *st)-
455{-
456 if (-
457 ((((
(((( st->st_mo... == (0020000))Description
TRUEnever evaluated
FALSEevaluated 137 times by 1 test
Evaluated by:
  • shred
0-137
458 st->st_mode
(((( st->st_mo... == (0020000))Description
TRUEnever evaluated
FALSEevaluated 137 times by 1 test
Evaluated by:
  • shred
0-137
459 )) & 0170000) == (0020000))
(((( st->st_mo... == (0020000))Description
TRUEnever evaluated
FALSEevaluated 137 times by 1 test
Evaluated by:
  • shred
0-137
460 )-
461 {-
462-
463-
464-
465-
466 struct mtop op;-
467 op.mt_op = -
468 6-
469 ;-
470 op.mt_count = 1;-
471 if (ioctl (fd,
ioctl (fd, (((...)) , &op) == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
472 (((1U) << (((0 +8)+8)+14)) | ((('m')) << (0 +8)) | (((1)) << 0) | ((((sizeof(struct mtop)))) << ((0 +8)+8)))
ioctl (fd, (((...)) , &op) == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
473 , &op) == 0
ioctl (fd, (((...)) , &op) == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
474 return
never executed: return 1 ;
never executed: return 1 ;
0
475 1
never executed: return 1 ;
0
476 ;
never executed: return 1 ;
0
477-
478 }
never executed: end of block
0
479 off_t offset = lseek (fd, 0, -
480 0-
481 );-
482 if (0 < offset
0 < offsetDescription
TRUEnever evaluated
FALSEevaluated 137 times by 1 test
Evaluated by:
  • shred
)
0-137
483 -
484 (*
never executed: (*__errno_location ()) = 22 ;
__errno_location ())
never executed: (*__errno_location ()) = 22 ;
0
485 =
never executed: (*__errno_location ()) = 22 ;
0
486 22
never executed: (*__errno_location ()) = 22 ;
0
487 ;
never executed: (*__errno_location ()) = 22 ;
0
488 return
executed 137 times by 1 test: return offset == 0;
Executed by:
  • shred
offset == 0;
executed 137 times by 1 test: return offset == 0;
Executed by:
  • shred
137
489}-
490-
491-
492-
493static -
494 _Bool-
495-
496known (off_t size)-
497{-
498 return
executed 366 times by 1 test: return 0 <= size;
Executed by:
  • shred
0 <= size;
executed 366 times by 1 test: return 0 <= size;
Executed by:
  • shred
366
499}-
500static int-
501dopass (int fd, struct stat const *st, char const *qname, off_t *sizep,-
502 int type, struct randread_source *s,-
503 unsigned long int k, unsigned long int n)-
504{-
505 off_t size = *sizep;-
506 off_t offset;-
507 time_t thresh ;-
508 time_t now = 0;-
509 size_t lim;-
510 size_t soff;-
511 ssize_t ssize;-
512-
513-
514 size_t page_size = getpagesize ();-
515-
516-
517 _Static_assert ((60 * 1024) % 3 == 0, "verify (" "PERIODIC_OUTPUT_SIZE % 3 == 0" ")");-
518 size_t output_size = periodic_pattern (type)
periodic_pattern (type)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 125 times by 1 test
Evaluated by:
  • shred
12-125
519 ? (60 * 1024) : (64 * 1024);-
520-
521-
522-
523 void *fill_pattern_mem = xmalloc (((page_size - 1) + (((output_size + 2) / 3) * 3)));-
524 unsigned char *pbuf = ptr_align (fill_pattern_mem, page_size);-
525-
526 char pass_string[7];-
527 -
528 _Bool -
529 write_error = -
530 0-
531 ;-
532 -
533 _Bool -
534 other_error = -
535 0-
536 ;-
537-
538-
539 char previous_offset_buf[((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * (-
540 16 -
541 + 1) - -
542 16 -
543 + 1 + 3) + 1];-
544 char const *previous_human_offset ;-
545-
546-
547-
548-
549 -
550 _Bool -
551 try_without_directio = 0 < size
0 < sizeDescription
TRUEevaluated 137 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
&& size < output_size
size < output_sizeDescription
TRUEevaluated 135 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 2 times by 1 test
Evaluated by:
  • shred
;
0-137
552 if (! try_without_directio
! try_without_directioDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 135 times by 1 test
Evaluated by:
  • shred
)
2-135
553 direct_mode (fd,
executed 2 times by 1 test: direct_mode (fd, 1 );
Executed by:
  • shred
2
554 1
executed 2 times by 1 test: direct_mode (fd, 1 );
Executed by:
  • shred
2
555 );
executed 2 times by 1 test: direct_mode (fd, 1 );
Executed by:
  • shred
2
556-
557 if (! dorewind (fd, st)
! dorewind (fd, st)Description
TRUEnever evaluated
FALSEevaluated 137 times by 1 test
Evaluated by:
  • shred
)
0-137
558 {-
559 error (0, -
560 (*__errno_location ())-
561 , -
562 dcgettext (((void *)0), -
563 "%s: cannot rewind"-
564 , 5)-
565 , qname);-
566 other_error = -
567 1-
568 ;-
569 goto
never executed: goto free_pattern_mem;
free_pattern_mem;
never executed: goto free_pattern_mem;
0
570 }-
571-
572-
573 if (type >= 0
type >= 0Description
TRUEevaluated 58 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 79 times by 1 test
Evaluated by:
  • shred
)
58-79
574 {-
575 lim = known (size)
known (size)Description
TRUEevaluated 58 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
&& size < (((output_size + 2) / 3) * 3)
size < (((outp...+ 2) / 3) * 3)Description
TRUEevaluated 58 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
? size : (((output_size + 2) / 3) * 3);
0-58
576 fillpattern (type, pbuf, lim);-
577 passname (pbuf, pass_string);-
578 }
executed 58 times by 1 test: end of block
Executed by:
  • shred
58
579 else-
580 {-
581 passname (0, pass_string);-
582 }
executed 79 times by 1 test: end of block
Executed by:
  • shred
79
583-
584-
585 if (n
nDescription
TRUEevaluated 23 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 114 times by 1 test
Evaluated by:
  • shred
)
23-114
586 {-
587 error (0, 0, -
588 dcgettext (((void *)0), -
589 "%s: pass %lu/%lu (%s)..."-
590 , 5)-
591 , qname, k, n, pass_string);-
592 thresh = time (-
593 ((void *)0)-
594 ) + VERBOSE_UPDATE;-
595 previous_human_offset = "";-
596 }
executed 23 times by 1 test: end of block
Executed by:
  • shred
23
597-
598 offset = 0;-
599 while (-
600 1-
601 )-
602 {-
603-
604 lim = output_size;-
605 if (known (size)
known (size)Description
TRUEevaluated 306 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
&& size - offset < output_size
size - offset < output_sizeDescription
TRUEevaluated 274 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 32 times by 1 test
Evaluated by:
  • shred
)
0-306
606 {-
607 if (size < offset
size < offsetDescription
TRUEnever evaluated
FALSEevaluated 274 times by 1 test
Evaluated by:
  • shred
)
0-274
608 break;
never executed: break;
0
609 lim = size - offset;-
610 if (!lim
!limDescription
TRUEevaluated 137 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 137 times by 1 test
Evaluated by:
  • shred
)
137
611 break;
executed 137 times by 1 test: break;
Executed by:
  • shred
137
612 }
executed 137 times by 1 test: end of block
Executed by:
  • shred
137
613 if (type < 0
type < 0Description
TRUEevaluated 111 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 58 times by 1 test
Evaluated by:
  • shred
)
58-111
614 randread (s, pbuf, lim);
executed 111 times by 1 test: randread (s, pbuf, lim);
Executed by:
  • shred
111
615-
616 for (soff = 0; soff < lim
soff < limDescription
TRUEevaluated 171 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 169 times by 1 test
Evaluated by:
  • shred
; soff += ssize)
169-171
617 {-
618 ssize = write (fd, pbuf + soff, lim - soff);-
619 if (0 < ssize
0 < ssizeDescription
TRUEevaluated 169 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 2 times by 1 test
Evaluated by:
  • shred
)
2-169
620 ((
executed 169 times by 1 test: ((ssize <= lim - soff) ? (void) 0 : __builtin_unreachable ());
Executed by:
  • shred
ssize <= lim - soff) ? (void) 0 : __builtin_unreachable ());
executed 169 times by 1 test: ((ssize <= lim - soff) ? (void) 0 : __builtin_unreachable ());
Executed by:
  • shred
169
621 else-
622 {-
623 if (! known (size)
! known (size)Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • shred
&& (ssize == 0
ssize == 0Description
TRUEnever evaluated
FALSEnever evaluated
||
0-2
624 (*
(*__errno_location ()) == 28Description
TRUEnever evaluated
FALSEnever evaluated
__errno_location ())
(*__errno_location ()) == 28Description
TRUEnever evaluated
FALSEnever evaluated
0
625 ==
(*__errno_location ()) == 28Description
TRUEnever evaluated
FALSEnever evaluated
0
626 28
(*__errno_location ()) == 28Description
TRUEnever evaluated
FALSEnever evaluated
0
627 ))-
628 {-
629-
630 if (soff <= ((off_t) (! (! ((off_t) 0 < (off_t) -1)) ? (off_t) -1 : ((((off_t) 1 << ((sizeof (off_t) * 8) - 2)) - 1) * 2 + 1))) - offset
soff <= ((off_... 1))) - offsetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
631 *
never executed: *sizep = size = offset + soff;
sizep = size = offset + soff;
never executed: *sizep = size = offset + soff;
0
632 break;
never executed: break;
0
633 }-
634 else-
635 {-
636 int errnum = -
637 (*__errno_location ())-
638 ;-
639 char buf[((((((sizeof (uintmax_t) * 8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)];-
640-
641-
642-
643-
644-
645 if (! try_without_directio
! try_without_directioDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
&&
0-2
646 (*
(*__errno_location ()) == 22Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
__errno_location ())
(*__errno_location ()) == 22Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-2
647 ==
(*__errno_location ()) == 22Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-2
648 22
(*__errno_location ()) == 22Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-2
649 )-
650 {-
651 direct_mode (fd, -
652 0-
653 );-
654 ssize = 0;-
655 try_without_directio = -
656 1-
657 ;-
658 continue;
executed 2 times by 1 test: continue;
Executed by:
  • shred
2
659 }-
660 error (0, errnum, -
661 dcgettext (((void *)0), -
662 "%s: error writing at offset %s"-
663 , 5)-
664 ,-
665 qname, umaxtostr (offset + soff, buf));-
666-
667-
668-
669-
670-
671-
672 _Static_assert ((60 * 1024) % SECTOR_SIZE == 0, "verify (" "PERIODIC_OUTPUT_SIZE % SECTOR_SIZE == 0" ")");-
673 _Static_assert ((64 * 1024) % SECTOR_SIZE == 0, "verify (" "NONPERIODIC_OUTPUT_SIZE % SECTOR_SIZE == 0" ")");-
674 if (errnum ==
errnum == 5Description
TRUEnever evaluated
FALSEnever evaluated
0
675 5
errnum == 5Description
TRUEnever evaluated
FALSEnever evaluated
0
676 && known (size)
known (size)Description
TRUEnever evaluated
FALSEnever evaluated
0
677 && (
(soff | SECTOR_MASK) < limDescription
TRUEnever evaluated
FALSEnever evaluated
soff | SECTOR_MASK) < lim
(soff | SECTOR_MASK) < limDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
678 {-
679 size_t soff1 = (soff | SECTOR_MASK) + 1;-
680 if (lseek (fd, offset + soff1,
lseek (fd, off...ff1, 0 ) != -1Description
TRUEnever evaluated
FALSEnever evaluated
0
681 0
lseek (fd, off...ff1, 0 ) != -1Description
TRUEnever evaluated
FALSEnever evaluated
0
682 ) != -1
lseek (fd, off...ff1, 0 ) != -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
683 {-
684-
685 ssize = soff1 - soff;-
686 write_error = -
687 1-
688 ;-
689 continue;
never executed: continue;
0
690 }-
691 error (0, -
692 (*__errno_location ())-
693 , -
694 dcgettext (((void *)0), -
695 "%s: lseek failed"-
696 , 5)-
697 , qname);-
698 }
never executed: end of block
0
699 other_error = -
700 1-
701 ;-
702 goto
never executed: goto free_pattern_mem;
free_pattern_mem;
never executed: goto free_pattern_mem;
0
703 }-
704 }-
705 }-
706-
707-
708-
709 if (((
((off_t) (! (!... offset < soffDescription
TRUEnever evaluated
FALSEevaluated 169 times by 1 test
Evaluated by:
  • shred
off_t) (! (! ((off_t) 0 < (off_t) -1)) ? (off_t) -1 : ((((off_t) 1 << ((sizeof (off_t) * 8) - 2)) - 1) * 2 + 1))) - offset < soff
((off_t) (! (!... offset < soffDescription
TRUEnever evaluated
FALSEevaluated 169 times by 1 test
Evaluated by:
  • shred
)
0-169
710 {-
711 error (0, 0, -
712 dcgettext (((void *)0), -
713 "%s: file too large"-
714 , 5)-
715 , qname);-
716 other_error = -
717 1-
718 ;-
719 goto
never executed: goto free_pattern_mem;
free_pattern_mem;
never executed: goto free_pattern_mem;
0
720 }-
721-
722 offset += soff;-
723-
724 -
725 _Bool -
726 done = offset == size;-
727-
728-
729 if (n
nDescription
TRUEevaluated 23 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 146 times by 1 test
Evaluated by:
  • shred
&& ((done
doneDescription
TRUEevaluated 23 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
&& *
*previous_human_offsetDescription
TRUEnever evaluated
FALSEevaluated 23 times by 1 test
Evaluated by:
  • shred
previous_human_offset
*previous_human_offsetDescription
TRUEnever evaluated
FALSEevaluated 23 times by 1 test
Evaluated by:
  • shred
)
0-146
730 || thresh <= (now = time (
thresh <= (now...((void *)0) ))Description
TRUEnever evaluated
FALSEevaluated 23 times by 1 test
Evaluated by:
  • shred
0-23
731 ((void *)0)
thresh <= (now...((void *)0) ))Description
TRUEnever evaluated
FALSEevaluated 23 times by 1 test
Evaluated by:
  • shred
0-23
732 ))
thresh <= (now...((void *)0) ))Description
TRUEnever evaluated
FALSEevaluated 23 times by 1 test
Evaluated by:
  • shred
))
0-23
733 {-
734 char offset_buf[((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * (-
735 16 -
736 + 1) - -
737 16 -
738 + 1 + 3) + 1];-
739 char size_buf[((2 * sizeof (uintmax_t) * 8 * 146 / 485 + 1) * (-
740 16 -
741 + 1) - -
742 16 -
743 + 1 + 3) + 1];-
744 int human_progress_opts = (human_autoscale | human_SI-
745 | human_base_1024 | human_B);-
746 char const *human_offset-
747 = human_readable (offset, offset_buf,-
748 human_floor | human_progress_opts, 1, 1);-
749-
750 if (done
doneDescription
TRUEnever evaluated
FALSEnever evaluated
|| !(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
751 __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
752 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
753 ) && __builtin_constant_p (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
754 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
755 ) && (__s1_len = __builtin_strlen (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
756 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
757 ), __s2_len = __builtin_strlen (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
758 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
759 ), (!((size_t)(const void *)((
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
760 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
761 ) + 1) - (size_t)(const void *)(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
762 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
763 ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
764 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
765 ) + 1) - (size_t)(const void *)(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
766 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
767 ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
768 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
769 ,
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
770 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
771 ) : (__builtin_constant_p (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
772 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
773 ) && ((size_t)(const void *)((
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
774 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
775 ) + 1) - (size_t)(const void *)(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
776 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
777 ) == 1) && (__s1_len = __builtin_strlen (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
778 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
779 ), __s1_len < 4) ? (__builtin_constant_p (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
780 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
781 ) && ((size_t)(const void *)((
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
782 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
783 ) + 1) - (size_t)(const void *)(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
784 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
785 ) == 1) ? __builtin_strcmp (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
786 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
787 ,
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
788 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
789 ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
790 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
791 ); int __result = (((const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
792 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
793 ))[0] - __s2[0]); if (__s1_len > 0
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
794 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
795 ))[1] - __s2[1]); if (__s1_len > 1
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
796 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
797 ))[2] - __s2[2]); if (__s1_len > 2
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( previous_human_offset ))[3] - __s2[3]);
0
798 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
never executed: __result = (((const unsigned char *) (const char *) ( previous_human_offset ))[3] - __s2[3]);
0
799 ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
800 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
801 ) && ((size_t)(const void *)((
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
802 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
803 ) + 1) - (size_t)(const void *)(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
804 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
805 ) == 1) && (__s2_len = __builtin_strlen (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
806 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
807 ), __s2_len < 4) ? (__builtin_constant_p (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
808 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
809 ) && ((size_t)(const void *)((
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
810 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
811 ) + 1) - (size_t)(const void *)(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
812 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
813 ) == 1) ? __builtin_strcmp (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
814 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
815 ,
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
816 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
817 ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
818 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
819 ); int __result = (((const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
820 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
821 ))[0] - __s2[0]); if (__s2_len > 0
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
822 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
823 ))[1] - __s2[1]); if (__s2_len > 1
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
824 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
825 ))[2] - __s2[2]); if (__s2_len > 2
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( human_offset ))[3] - __s2[3]);
0
826 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
never executed: __result = (((const unsigned char *) (const char *) ( human_offset ))[3] - __s2[3]);
0
827 ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
828 previous_human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
829 ,
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
830 human_offset
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
831 )))); })
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
832 == 0)
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
833 {-
834 if (! known (size)
! known (size)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
835 error (0, 0,
never executed: error (0, 0, dcgettext (((void *)0), "%s: pass %lu/%lu (%s)...%s" , 5) , qname, k, n, pass_string, human_offset);
0
836 dcgettext (((void *)0),
never executed: error (0, 0, dcgettext (((void *)0), "%s: pass %lu/%lu (%s)...%s" , 5) , qname, k, n, pass_string, human_offset);
0
837 "%s: pass %lu/%lu (%s)...%s"
never executed: error (0, 0, dcgettext (((void *)0), "%s: pass %lu/%lu (%s)...%s" , 5) , qname, k, n, pass_string, human_offset);
0
838 , 5)
never executed: error (0, 0, dcgettext (((void *)0), "%s: pass %lu/%lu (%s)...%s" , 5) , qname, k, n, pass_string, human_offset);
0
839 ,
never executed: error (0, 0, dcgettext (((void *)0), "%s: pass %lu/%lu (%s)...%s" , 5) , qname, k, n, pass_string, human_offset);
0
840 qname, k, n, pass_string, human_offset);
never executed: error (0, 0, dcgettext (((void *)0), "%s: pass %lu/%lu (%s)...%s" , 5) , qname, k, n, pass_string, human_offset);
0
841 else-
842 {-
843 uintmax_t off = offset;-
844 int percent = (size == 0
size == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
845 ? 100-
846 : (off <= ((uintmax_t) (! (! ((uintmax_t) 0 < (uintmax_t) -1)) ? (uintmax_t) -1 : ((((uintmax_t) 1 << ((sizeof (uintmax_t) * 8) - 2)) - 1) * 2 + 1))) / 100
off <= ((uintm...2 + 1))) / 100Description
TRUEnever evaluated
FALSEnever evaluated
0
847 ? off * 100 / size-
848 : off / (size / 100)));-
849 char const *human_size-
850 = human_readable (size, size_buf,-
851 human_ceiling | human_progress_opts,-
852 1, 1);-
853 if (done
doneDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
854 human_offset = human_size;
never executed: human_offset = human_size;
0
855 error (0, 0, -
856 dcgettext (((void *)0), -
857 "%s: pass %lu/%lu (%s)...%s/%s %d%%"-
858 , 5)-
859 ,-
860 qname, k, n, pass_string, human_offset, human_size,-
861 percent);-
862 }
never executed: end of block
0
863-
864 strcpy (previous_offset_buf, human_offset);-
865 previous_human_offset = previous_offset_buf;-
866 thresh = now + VERBOSE_UPDATE;-
867 if (dosync (fd, qname) != 0
dosync (fd, qname) != 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
868 {-
869 if (-
870 (*
(*__errno_location ()) != 5Description
TRUEnever evaluated
FALSEnever evaluated
__errno_location ())
(*__errno_location ()) != 5Description
TRUEnever evaluated
FALSEnever evaluated
0
871 !=
(*__errno_location ()) != 5Description
TRUEnever evaluated
FALSEnever evaluated
0
872 5
(*__errno_location ()) != 5Description
TRUEnever evaluated
FALSEnever evaluated
0
873 )-
874 {-
875 other_error = -
876 1-
877 ;-
878 goto
never executed: goto free_pattern_mem;
free_pattern_mem;
never executed: goto free_pattern_mem;
0
879 }-
880 write_error = -
881 1-
882 ;-
883 }
never executed: end of block
0
884 }
never executed: end of block
0
885 }
never executed: end of block
0
886 }
executed 169 times by 1 test: end of block
Executed by:
  • shred
169
887-
888-
889 if (dosync (fd, qname) != 0
dosync (fd, qname) != 0Description
TRUEnever evaluated
FALSEevaluated 137 times by 1 test
Evaluated by:
  • shred
)
0-137
890 {-
891 if (-
892 (*
(*__errno_location ()) != 5Description
TRUEnever evaluated
FALSEnever evaluated
__errno_location ())
(*__errno_location ()) != 5Description
TRUEnever evaluated
FALSEnever evaluated
0
893 !=
(*__errno_location ()) != 5Description
TRUEnever evaluated
FALSEnever evaluated
0
894 5
(*__errno_location ()) != 5Description
TRUEnever evaluated
FALSEnever evaluated
0
895 )-
896 {-
897 other_error = -
898 1-
899 ;-
900 goto
never executed: goto free_pattern_mem;
free_pattern_mem;
never executed: goto free_pattern_mem;
0
901 }-
902 write_error = -
903 1-
904 ;-
905 }
never executed: end of block
0
906-
907free_pattern_mem:
code before this statement executed 137 times by 1 test: free_pattern_mem:
Executed by:
  • shred
137
908 free (fill_pattern_mem);-
909-
910 return
executed 137 times by 1 test: return other_error ? -1 : write_error;
Executed by:
  • shred
other_error ? -1 : write_error;
executed 137 times by 1 test: return other_error ? -1 : write_error;
Executed by:
  • shred
137
911}-
912static int const-
913 patterns[] =-
914{-
915 -2,-
916 2, 0x000, 0xFFF,-
917 2, 0x555, 0xAAA,-
918 -1,-
919 6, 0x249, 0x492, 0x6DB, 0x924, 0xB6D, 0xDB6,-
920 12, 0x111, 0x222, 0x333, 0x444, 0x666, 0x777,-
921 0x888, 0x999, 0xBBB, 0xCCC, 0xDDD, 0xEEE,-
922 -1,-
923-
924 8, 0x1000, 0x1249, 0x1492, 0x16DB, 0x1924, 0x1B6D, 0x1DB6, 0x1FFF,-
925 14, 0x1111, 0x1222, 0x1333, 0x1444, 0x1555, 0x1666, 0x1777,-
926 0x1888, 0x1999, 0x1AAA, 0x1BBB, 0x1CCC, 0x1DDD, 0x1EEE,-
927 -1,-
928 0-
929};-
930-
931-
932-
933-
934-
935-
936-
937static void-
938genpattern (int *dest, size_t num, struct randint_source *s)-
939{-
940 size_t randpasses;-
941 int const *p;-
942 int *d;-
943 size_t n;-
944 size_t accum, top, swap;-
945 int k;-
946-
947 if (!num
!numDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 21 times by 1 test
Evaluated by:
  • shred
)
4-21
948 return;
executed 4 times by 1 test: return;
Executed by:
  • shred
4
949-
950-
951 p = patterns;-
952 randpasses = 0;-
953 d = dest;-
954 n = num;-
955-
956 while (-
957 1-
958 )-
959 {-
960 k = *p++;-
961 if (!k
!kDescription
TRUEnever evaluated
FALSEevaluated 49 times by 1 test
Evaluated by:
  • shred
)
0-49
962 {-
963 p = patterns;-
964 }
never executed: end of block
0
965 else if (k < 0
k < 0Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 27 times by 1 test
Evaluated by:
  • shred
)
22-27
966 {-
967 k = -k;-
968 if ((
(size_t) k >= nDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 20 times by 1 test
Evaluated by:
  • shred
size_t) k >= n
(size_t) k >= nDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 20 times by 1 test
Evaluated by:
  • shred
)
2-20
969 {-
970 randpasses += n;-
971 break;
executed 2 times by 1 test: break;
Executed by:
  • shred
2
972 }-
973 randpasses += k;-
974 n -= k;-
975 }
executed 20 times by 1 test: end of block
Executed by:
  • shred
20
976 else if ((
(size_t) k <= nDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 19 times by 1 test
Evaluated by:
  • shred
size_t) k <= n
(size_t) k <= nDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 19 times by 1 test
Evaluated by:
  • shred
)
8-19
977 {-
978 memcpy (d, p, k * sizeof (int));-
979 p += k;-
980 d += k;-
981 n -= k;-
982 }
executed 8 times by 1 test: end of block
Executed by:
  • shred
8
983 else if (n < 2
n < 2Description
TRUEevaluated 18 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 1 time by 1 test
Evaluated by:
  • shred
|| 3 * n < (size_t) k
3 * n < (size_t) kDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • shred
)
0-18
984 {-
985 randpasses += n;-
986 break;
executed 18 times by 1 test: break;
Executed by:
  • shred
18
987 }-
988 else-
989 {-
990 do-
991 {-
992 if (n == (size_t) k
n == (size_t) kDescription
TRUEevaluated 1 time by 1 test
Evaluated by:
  • shred
FALSEevaluated 11 times by 1 test
Evaluated by:
  • shred
|| randint_choose (s, k) < n
randint_choose (s, k) < nDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 5 times by 1 test
Evaluated by:
  • shred
)
1-11
993 {-
994 *d++ = *p;-
995 n--;-
996 }
executed 7 times by 1 test: end of block
Executed by:
  • shred
7
997 p++;-
998 k--;-
999 }
executed 12 times by 1 test: end of block
Executed by:
  • shred
12
1000 while (n
nDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 1 time by 1 test
Evaluated by:
  • shred
);
1-11
1001 break;
executed 1 time by 1 test: break;
Executed by:
  • shred
1
1002 }-
1003 }-
1004 top = num - randpasses;-
1005 randpasses--;-
1006 accum = randpasses;-
1007 for (n = 0; n < num
n < numDescription
TRUEevaluated 83 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 21 times by 1 test
Evaluated by:
  • shred
; n++)
21-83
1008 {-
1009 if (accum <= randpasses
accum <= randpassesDescription
TRUEevaluated 56 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 27 times by 1 test
Evaluated by:
  • shred
)
27-56
1010 {-
1011 accum += num - 1;-
1012 dest[top++] = dest[n];-
1013 dest[n] = -1;-
1014 }
executed 56 times by 1 test: end of block
Executed by:
  • shred
56
1015 else-
1016 {-
1017 swap = n + randint_choose (s, top - n);-
1018 k = dest[n];-
1019 dest[n] = dest[swap];-
1020 dest[swap] = k;-
1021 }
executed 27 times by 1 test: end of block
Executed by:
  • shred
27
1022 accum -= randpasses;-
1023 }
executed 83 times by 1 test: end of block
Executed by:
  • shred
83
1024-
1025}
executed 21 times by 1 test: end of block
Executed by:
  • shred
21
1026-
1027-
1028-
1029-
1030-
1031static -
1032 _Bool-
1033-
1034do_wipefd (int fd, char const *qname, struct randint_source *s,-
1035 struct Options const *flags)-
1036{-
1037 size_t i;-
1038 struct stat st;-
1039 off_t size;-
1040 off_t i_size = 0;-
1041 unsigned long int n;-
1042 int *passarray;-
1043 -
1044 _Bool -
1045 ok = -
1046 1-
1047 ;-
1048 struct randread_source *rs;-
1049-
1050 n = 0;-
1051 if (flags->verbose
flags->verboseDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 21 times by 1 test
Evaluated by:
  • shred
)
4-21
1052 n = flags->n_iterations + flags->zero_fill;
executed 4 times by 1 test: n = flags->n_iterations + flags->zero_fill;
Executed by:
  • shred
4
1053-
1054 if (fstat (fd, &st)
fstat (fd, &st)Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
)
0-25
1055 {-
1056 error (0, -
1057 (*__errno_location ())-
1058 , -
1059 dcgettext (((void *)0), -
1060 "%s: fstat failed"-
1061 , 5)-
1062 , qname);-
1063 return
never executed: return 0 ;
never executed: return 0 ;
0
1064 0
never executed: return 0 ;
0
1065 ;
never executed: return 0 ;
0
1066 }-
1067-
1068-
1069-
1070-
1071 if ((-
1072 ((((
(((( st.st_mod... == (0020000))Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
0-25
1073 st.st_mode
(((( st.st_mod... == (0020000))Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
0-25
1074 )) & 0170000) == (0020000))
(((( st.st_mod... == (0020000))Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
0-25
1075 && isatty (fd)
isatty (fd)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1076 || -
1077 ((((
(((( st.st_mod... == (0010000))Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
0-25
1078 st.st_mode
(((( st.st_mod... == (0010000))Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
0-25
1079 )) & 0170000) == (0010000))
(((( st.st_mod... == (0010000))Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
0-25
1080 -
1081 || -
1082 ((((
(((( st.st_mod... == (0140000))Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
0-25
1083 st.st_mode
(((( st.st_mod... == (0140000))Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
0-25
1084 )) & 0170000) == (0140000))
(((( st.st_mod... == (0140000))Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
0-25
1085 )-
1086 {-
1087 error (0, 0, -
1088 dcgettext (((void *)0), -
1089 "%s: invalid file type"-
1090 , 5)-
1091 , qname);-
1092 return
never executed: return 0 ;
never executed: return 0 ;
0
1093 0
never executed: return 0 ;
0
1094 ;
never executed: return 0 ;
0
1095 }-
1096 else if (-
1097 ((((
(((( st.st_mod... == (0100000))Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-25
1098 st.st_mode
(((( st.st_mod... == (0100000))Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-25
1099 )) & 0170000) == (0100000))
(((( st.st_mod... == (0100000))Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-25
1100 && st.st_size < 0
st.st_size < 0Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
)
0-25
1101 {-
1102 error (0, 0, -
1103 dcgettext (((void *)0), -
1104 "%s: file has negative size"-
1105 , 5)-
1106 , qname);-
1107 return
never executed: return 0 ;
never executed: return 0 ;
0
1108 0
never executed: return 0 ;
0
1109 ;
never executed: return 0 ;
0
1110 }-
1111-
1112-
1113 passarray = xnmalloc (flags->n_iterations, sizeof *passarray);-
1114-
1115 size = flags->size;-
1116 if (size == -1
size == -1Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 8 times by 1 test
Evaluated by:
  • shred
)
8-17
1117 {-
1118 if (-
1119 ((((
(((( st.st_mod... == (0100000))Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-17
1120 st.st_mode
(((( st.st_mod... == (0100000))Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-17
1121 )) & 0170000) == (0100000))
(((( st.st_mod... == (0100000))Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-17
1122 )-
1123 {-
1124 size = st.st_size;-
1125-
1126 if (! flags->exact
! flags->exactDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 5 times by 1 test
Evaluated by:
  • shred
)
5-12
1127 {-
1128-
1129 off_t remainder = size % ((0 < (st).st_blksize
0 < (st).st_blksizeDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
&& (
(st).st_blksiz..._t)-1) / 8 + 1Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
st).st_blksize <= ((size_t)-1) / 8 + 1
(st).st_blksiz..._t)-1) / 8 + 1Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
) ? (st).st_blksize :
0-12
1130 512-
1131 );-
1132 if (size
sizeDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 7 times by 1 test
Evaluated by:
  • shred
&& size < ((0 < (st).st_blksize && (st).st_blksize <= ((size_t)-1) / 8 + 1) ? (st).st_blksize :
size < ((0 < (...lksize : 512 )Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-7
1133 512
size < ((0 < (...lksize : 512 )Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-5
1134 )
size < ((0 < (...lksize : 512 )Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
)
0-5
1135 i_size = size;
executed 5 times by 1 test: i_size = size;
Executed by:
  • shred
5
1136 if (remainder != 0
remainder != 0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 7 times by 1 test
Evaluated by:
  • shred
)
5-7
1137 {-
1138 off_t size_incr = ((0 < (st).st_blksize
0 < (st).st_blksizeDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
&& (
(st).st_blksiz..._t)-1) / 8 + 1Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
st).st_blksize <= ((size_t)-1) / 8 + 1
(st).st_blksiz..._t)-1) / 8 + 1Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
) ? (st).st_blksize :
0-5
1139 512-
1140 ) - remainder;-
1141 size += -
1142 (((
(( size_incr )...1))) - size ))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-5
1143 size_incr
(( size_incr )...1))) - size ))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-5
1144 )<(
(( size_incr )...1))) - size ))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-5
1145 ((off_t) (! (! ((off_t) 0 < (off_t) -1)) ? (off_t) -1 : ((((off_t) 1 << ((sizeof (off_t) * 8) - 2)) - 1) * 2 + 1))) - size
(( size_incr )...1))) - size ))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-5
1146 ))
(( size_incr )...1))) - size ))Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
?(
0-5
1147 size_incr-
1148 ):(-
1149 ((off_t) (! (! ((off_t) 0 < (off_t) -1)) ? (off_t) -1 : ((((off_t) 1 << ((sizeof (off_t) * 8) - 2)) - 1) * 2 + 1))) - size-
1150 ))-
1151 ;-
1152 }
executed 5 times by 1 test: end of block
Executed by:
  • shred
5
1153 }
executed 12 times by 1 test: end of block
Executed by:
  • shred
12
1154 }
executed 17 times by 1 test: end of block
Executed by:
  • shred
17
1155 else-
1156 {-
1157-
1158-
1159-
1160 size = lseek (fd, 0, -
1161 2-
1162 );-
1163 if (size <= 0
size <= 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1164 {-
1165-
1166-
1167 size = -1;-
1168 }
never executed: end of block
0
1169 }
never executed: end of block
0
1170 }-
1171 else if (-
1172 ((((
(((( st.st_mod... == (0100000))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1173 st.st_mode
(((( st.st_mod... == (0100000))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1174 )) & 0170000) == (0100000))
(((( st.st_mod... == (0100000))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1175 -
1176 && st.st_size <
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1177 (((
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1178 ((0 < (st).st_blksize && (st).st_blksize <= ((size_t)-1) / 8 + 1) ? (st).st_blksize :
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1179 512
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1180 )
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1181 )<(
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1182 size
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1183 ))?(
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1184 ((0 < (st).st_blksize && (st).st_blksize <= ((size_t)-1) / 8 + 1) ? (st).st_blksize :
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1185 512
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1186 )
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1187 ):(
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1188 size
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1189 ))
st.st_size < (... ) ):( size ))Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-8
1190 )-
1191 i_size = st.st_size;
executed 8 times by 1 test: i_size = st.st_size;
Executed by:
  • shred
8
1192-
1193-
1194 genpattern (passarray, flags->n_iterations, s);-
1195-
1196 rs = randint_get_source (s);-
1197-
1198 while (-
1199 1-
1200 )-
1201 {-
1202 off_t pass_size;-
1203 unsigned long int pn = n;-
1204-
1205 if (i_size
i_sizeDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 43 times by 1 test
Evaluated by:
  • shred
)
12-43
1206 {-
1207 pass_size = i_size;-
1208 i_size = 0;-
1209 pn = 0;-
1210 }
executed 12 times by 1 test: end of block
Executed by:
  • shred
12
1211 else if (size
sizeDescription
TRUEevaluated 18 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
)
18-25
1212 {-
1213 pass_size = size;-
1214 size = 0;-
1215 }
executed 18 times by 1 test: end of block
Executed by:
  • shred
18
1216-
1217-
1218-
1219 else-
1220 break;
executed 25 times by 1 test: break;
Executed by:
  • shred
25
1221-
1222 for (i = 0; i < flags->n_iterations + flags->zero_fill
i < flags->n_i...ags->zero_fillDescription
TRUEevaluated 137 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 30 times by 1 test
Evaluated by:
  • shred
; i++)
30-137
1223 {-
1224 int err = 0;-
1225 int type = i < flags->n_iterations
i < flags->n_iterationsDescription
TRUEevaluated 131 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 6 times by 1 test
Evaluated by:
  • shred
? passarray[i] : 0;
6-131
1226-
1227 err = dopass (fd, &st, qname, &pass_size, type, rs, i + 1, pn);-
1228-
1229 if (err
errDescription
TRUEnever evaluated
FALSEevaluated 137 times by 1 test
Evaluated by:
  • shred
)
0-137
1230 {-
1231 ok = -
1232 0-
1233 ;-
1234 if (err < 0
err < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1235 goto
never executed: goto wipefd_out;
wipefd_out;
never executed: goto wipefd_out;
0
1236 }
never executed: end of block
0
1237 }
executed 137 times by 1 test: end of block
Executed by:
  • shred
137
1238 }
executed 30 times by 1 test: end of block
Executed by:
  • shred
30
1239-
1240-
1241-
1242-
1243 if (flags->remove_file
flags->remove_fileDescription
TRUEevaluated 15 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 10 times by 1 test
Evaluated by:
  • shred
&& ftruncate (fd, 0) != 0
ftruncate (fd, 0) != 0Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • shred
0-15
1244 && -
1245 ((((
(((( st.st_mod... == (0100000))Description
TRUEnever evaluated
FALSEnever evaluated
0
1246 st.st_mode
(((( st.st_mod... == (0100000))Description
TRUEnever evaluated
FALSEnever evaluated
0
1247 )) & 0170000) == (0100000))
(((( st.st_mod... == (0100000))Description
TRUEnever evaluated
FALSEnever evaluated
0
1248 )-
1249 {-
1250 error (0, -
1251 (*__errno_location ())-
1252 , -
1253 dcgettext (((void *)0), -
1254 "%s: error truncating"-
1255 , 5)-
1256 , qname);-
1257 ok = -
1258 0-
1259 ;-
1260 goto
never executed: goto wipefd_out;
wipefd_out;
never executed: goto wipefd_out;
0
1261 }-
1262-
1263wipefd_out:
code before this statement executed 25 times by 1 test: wipefd_out:
Executed by:
  • shred
25
1264 free (passarray);-
1265 return
executed 25 times by 1 test: return ok;
Executed by:
  • shred
ok;
executed 25 times by 1 test: return ok;
Executed by:
  • shred
25
1266}-
1267-
1268-
1269static -
1270 _Bool-
1271-
1272wipefd (int fd, char const *qname, struct randint_source *s,-
1273 struct Options const *flags)-
1274{-
1275 int fd_flags = -
1276 rpl_fcntl -
1277 (fd, -
1278 3-
1279 );-
1280-
1281 if (fd_flags < 0
fd_flags < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1282 {-
1283 error (0, -
1284 (*__errno_location ())-
1285 , -
1286 dcgettext (((void *)0), -
1287 "%s: fcntl failed"-
1288 , 5)-
1289 , qname);-
1290 return
never executed: return 0 ;
never executed: return 0 ;
0
1291 0
never executed: return 0 ;
0
1292 ;
never executed: return 0 ;
0
1293 }-
1294 if (fd_flags &
fd_flags & 02000Description
TRUEnever evaluated
FALSEnever evaluated
0
1295 02000
fd_flags & 02000Description
TRUEnever evaluated
FALSEnever evaluated
0
1296 )-
1297 {-
1298 error (0, 0, -
1299 dcgettext (((void *)0), -
1300 "%s: cannot shred append-only file descriptor"-
1301 , 5)-
1302 , qname);-
1303 return
never executed: return 0 ;
never executed: return 0 ;
0
1304 0
never executed: return 0 ;
0
1305 ;
never executed: return 0 ;
0
1306 }-
1307 return
never executed: return do_wipefd (fd, qname, s, flags);
do_wipefd (fd, qname, s, flags);
never executed: return do_wipefd (fd, qname, s, flags);
0
1308}-
1309-
1310-
1311-
1312-
1313static char const nameset[] =-
1314"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_.";-
1315-
1316-
1317-
1318-
1319-
1320-
1321static -
1322 _Bool-
1323-
1324incname (char *name, size_t len)-
1325{-
1326 while (len--
len--Description
TRUEevaluated 65 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 1 time by 1 test
Evaluated by:
  • shred
)
1-65
1327 {-
1328 char const *p = -
1329 (__extension__ (__builtin_constant_p (
__builtin_cons... ( name[len] )Description
TRUEnever evaluated
FALSEevaluated 65 times by 1 test
Evaluated by:
  • shred
0-65
1330 name[len]
__builtin_cons... ( name[len] )Description
TRUEnever evaluated
FALSEevaluated 65 times by 1 test
Evaluated by:
  • shred
0-65
1331 )
__builtin_cons... ( name[len] )Description
TRUEnever evaluated
FALSEevaluated 65 times by 1 test
Evaluated by:
  • shred
&& !__builtin_constant_p (
!__builtin_con..._p ( nameset )Description
TRUEnever evaluated
FALSEnever evaluated
0-65
1332 nameset
!__builtin_con..._p ( nameset )Description
TRUEnever evaluated
FALSEnever evaluated
0
1333 )
!__builtin_con..._p ( nameset )Description
TRUEnever evaluated
FALSEnever evaluated
&& (
( name[len] ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1334 name[len]
( name[len] ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
0
1335 ) == '\0'
( name[len] ) == '\0'Description
TRUEnever evaluated
FALSEnever evaluated
? (char *) __rawmemchr (
0
1336 nameset-
1337 , -
1338 name[len]-
1339 ) : __builtin_strchr (-
1340 nameset-
1341 , -
1342 name[len]-
1343 )))-
1344 ;-
1345-
1346-
1347-
1348 -
1349 ((-
1350 p-
1351 ) ? (void) (0) : __assert_fail (-
1352 "p"-
1353 , "src/shred.c", 1034, __PRETTY_FUNCTION__))-
1354 ;-
1355-
1356-
1357 if (p[1]
p[1]Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 1 time by 1 test
Evaluated by:
  • shred
)
1-64
1358 {-
1359 name[len] = p[1];-
1360 return
executed 64 times by 1 test: return 1 ;
Executed by:
  • shred
executed 64 times by 1 test: return 1 ;
Executed by:
  • shred
64
1361 1
executed 64 times by 1 test: return 1 ;
Executed by:
  • shred
64
1362 ;
executed 64 times by 1 test: return 1 ;
Executed by:
  • shred
64
1363 }-
1364-
1365-
1366 name[len] = nameset[0];-
1367 }
executed 1 time by 1 test: end of block
Executed by:
  • shred
1
1368-
1369 return
executed 1 time by 1 test: return 0 ;
Executed by:
  • shred
executed 1 time by 1 test: return 0 ;
Executed by:
  • shred
1
1370 0
executed 1 time by 1 test: return 0 ;
Executed by:
  • shred
1
1371 ;
executed 1 time by 1 test: return 0 ;
Executed by:
  • shred
1
1372}-
1373static -
1374 _Bool-
1375-
1376wipename (char *oldname, char const *qoldname, struct Options const *flags)-
1377{-
1378 char *newname = xstrdup (oldname);-
1379 char *base = last_component (newname);-
1380 char *dir = dir_name (newname);-
1381 char *qdir = xstrdup (quotearg_n_style_colon (0, shell_escape_quoting_style, dir));-
1382 -
1383 _Bool -
1384 first = -
1385 1-
1386 ;-
1387 -
1388 _Bool -
1389 ok = -
1390 1-
1391 ;-
1392 int dir_fd = -1;-
1393-
1394 if (flags->remove_file == remove_wipesync
flags->remove_...emove_wipesyncDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 2 times by 1 test
Evaluated by:
  • shred
)
2-13
1395 dir_fd = open_safer (dir,
executed 13 times by 1 test: dir_fd = open_safer (dir, 00 | 0200000 | 0400 | 04000 );
Executed by:
  • shred
13
1396 00
executed 13 times by 1 test: dir_fd = open_safer (dir, 00 | 0200000 | 0400 | 04000 );
Executed by:
  • shred
13
1397 |
executed 13 times by 1 test: dir_fd = open_safer (dir, 00 | 0200000 | 0400 | 04000 );
Executed by:
  • shred
13
1398 0200000
executed 13 times by 1 test: dir_fd = open_safer (dir, 00 | 0200000 | 0400 | 04000 );
Executed by:
  • shred
13
1399 |
executed 13 times by 1 test: dir_fd = open_safer (dir, 00 | 0200000 | 0400 | 04000 );
Executed by:
  • shred
13
1400 0400
executed 13 times by 1 test: dir_fd = open_safer (dir, 00 | 0200000 | 0400 | 04000 );
Executed by:
  • shred
13
1401 |
executed 13 times by 1 test: dir_fd = open_safer (dir, 00 | 0200000 | 0400 | 04000 );
Executed by:
  • shred
13
1402 04000
executed 13 times by 1 test: dir_fd = open_safer (dir, 00 | 0200000 | 0400 | 04000 );
Executed by:
  • shred
13
1403 );
executed 13 times by 1 test: dir_fd = open_safer (dir, 00 | 0200000 | 0400 | 04000 );
Executed by:
  • shred
13
1404-
1405 if (flags->verbose
flags->verboseDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 11 times by 1 test
Evaluated by:
  • shred
)
4-11
1406 error (0, 0,
executed 4 times by 1 test: error (0, 0, dcgettext (((void *)0), "%s: removing" , 5) , qoldname);
Executed by:
  • shred
4
1407 dcgettext (((void *)0),
executed 4 times by 1 test: error (0, 0, dcgettext (((void *)0), "%s: removing" , 5) , qoldname);
Executed by:
  • shred
4
1408 "%s: removing"
executed 4 times by 1 test: error (0, 0, dcgettext (((void *)0), "%s: removing" , 5) , qoldname);
Executed by:
  • shred
4
1409 , 5)
executed 4 times by 1 test: error (0, 0, dcgettext (((void *)0), "%s: removing" , 5) , qoldname);
Executed by:
  • shred
4
1410 , qoldname);
executed 4 times by 1 test: error (0, 0, dcgettext (((void *)0), "%s: removing" , 5) , qoldname);
Executed by:
  • shred
4
1411-
1412 if (flags->remove_file != remove_unlink
flags->remove_... remove_unlinkDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 1 time by 1 test
Evaluated by:
  • shred
)
1-14
1413 for (size_t len = base_len (base); len != 0
len != 0Description
TRUEevaluated 53 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 14 times by 1 test
Evaluated by:
  • shred
; len--)
14-53
1414 {-
1415 memset (base, nameset[0], len);-
1416 base[len] = 0;-
1417 -
1418 _Bool -
1419 rename_ok;-
1420 while (! (rename_ok = (renameat2 (
! (rename_ok =...<< 0) ) == 0))Description
TRUEevaluated 75 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 42 times by 1 test
Evaluated by:
  • shred
42-75
1421 -100
! (rename_ok =...<< 0) ) == 0))Description
TRUEevaluated 75 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 42 times by 1 test
Evaluated by:
  • shred
42-75
1422 , oldname,
! (rename_ok =...<< 0) ) == 0))Description
TRUEevaluated 75 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 42 times by 1 test
Evaluated by:
  • shred
42-75
1423 -100
! (rename_ok =...<< 0) ) == 0))Description
TRUEevaluated 75 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 42 times by 1 test
Evaluated by:
  • shred
42-75
1424 , newname,
! (rename_ok =...<< 0) ) == 0))Description
TRUEevaluated 75 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 42 times by 1 test
Evaluated by:
  • shred
42-75
1425
! (rename_ok =...<< 0) ) == 0))Description
TRUEevaluated 75 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 42 times by 1 test
Evaluated by:
  • shred
42-75
1426 (1 << 0)
! (rename_ok =...<< 0) ) == 0))Description
TRUEevaluated 75 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 42 times by 1 test
Evaluated by:
  • shred
42-75
1427 )
! (rename_ok =...<< 0) ) == 0))Description
TRUEevaluated 75 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 42 times by 1 test
Evaluated by:
  • shred
42-75
1428 == 0))
! (rename_ok =...<< 0) ) == 0))Description
TRUEevaluated 75 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 42 times by 1 test
Evaluated by:
  • shred
42-75
1429 && -
1430 (*
(*__errno_location ()) == 17Description
TRUEevaluated 65 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 10 times by 1 test
Evaluated by:
  • shred
__errno_location ())
(*__errno_location ()) == 17Description
TRUEevaluated 65 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 10 times by 1 test
Evaluated by:
  • shred
10-65
1431 ==
(*__errno_location ()) == 17Description
TRUEevaluated 65 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 10 times by 1 test
Evaluated by:
  • shred
10-65
1432 17
(*__errno_location ()) == 17Description
TRUEevaluated 65 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 10 times by 1 test
Evaluated by:
  • shred
10-65
1433 && incname (base, len)
incname (base, len)Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 1 time by 1 test
Evaluated by:
  • shred
)
1-64
1434 continue;
executed 64 times by 1 test: continue;
Executed by:
  • shred
64
1435 if (rename_ok
rename_okDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 11 times by 1 test
Evaluated by:
  • shred
)
11-42
1436 {-
1437 if (0 <= dir_fd
0 <= dir_fdDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 10 times by 1 test
Evaluated by:
  • shred
&& dosync (dir_fd, qdir) != 0
dosync (dir_fd, qdir) != 0Description
TRUEnever evaluated
FALSEevaluated 32 times by 1 test
Evaluated by:
  • shred
)
0-32
1438 ok =
never executed: ok = 0 ;
0
1439 0
never executed: ok = 0 ;
0
1440 ;
never executed: ok = 0 ;
0
1441 if (flags->verbose
flags->verboseDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 36 times by 1 test
Evaluated by:
  • shred
)
6-36
1442 {-
1443-
1444-
1445-
1446-
1447 char const *old = first
firstDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 2 times by 1 test
Evaluated by:
  • shred
? qoldname : oldname;
2-4
1448 error (0, 0,-
1449 -
1450 dcgettext (((void *)0), -
1451 "%s: renamed to %s"-
1452 , 5)-
1453 , old, newname);-
1454 first = -
1455 0-
1456 ;-
1457 }
executed 6 times by 1 test: end of block
Executed by:
  • shred
6
1458 memcpy (oldname + (base - newname), base, len + 1);-
1459 }
executed 42 times by 1 test: end of block
Executed by:
  • shred
42
1460 }
executed 53 times by 1 test: end of block
Executed by:
  • shred
53
1461-
1462 if (unlink (oldname) != 0
unlink (oldname) != 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • shred
FALSEevaluated 14 times by 1 test
Evaluated by:
  • shred
)
1-14
1463 {-
1464 error (0, -
1465 (*__errno_location ())-
1466 , -
1467 dcgettext (((void *)0), -
1468 "%s: failed to remove"-
1469 , 5)-
1470 , qoldname);-
1471 ok = -
1472 0-
1473 ;-
1474 }
executed 1 time by 1 test: end of block
Executed by:
  • shred
1
1475 else if (flags->verbose
flags->verboseDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 10 times by 1 test
Evaluated by:
  • shred
)
4-10
1476 error (0, 0,
executed 4 times by 1 test: error (0, 0, dcgettext (((void *)0), "%s: removed" , 5) , qoldname);
Executed by:
  • shred
4
1477 dcgettext (((void *)0),
executed 4 times by 1 test: error (0, 0, dcgettext (((void *)0), "%s: removed" , 5) , qoldname);
Executed by:
  • shred
4
1478 "%s: removed"
executed 4 times by 1 test: error (0, 0, dcgettext (((void *)0), "%s: removed" , 5) , qoldname);
Executed by:
  • shred
4
1479 , 5)
executed 4 times by 1 test: error (0, 0, dcgettext (((void *)0), "%s: removed" , 5) , qoldname);
Executed by:
  • shred
4
1480 , qoldname);
executed 4 times by 1 test: error (0, 0, dcgettext (((void *)0), "%s: removed" , 5) , qoldname);
Executed by:
  • shred
4
1481 if (0 <= dir_fd
0 <= dir_fdDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 2 times by 1 test
Evaluated by:
  • shred
)
2-13
1482 {-
1483 if (dosync (dir_fd, qdir) != 0
dosync (dir_fd, qdir) != 0Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • shred
)
0-13
1484 ok =
never executed: ok = 0 ;
0
1485 0
never executed: ok = 0 ;
0
1486 ;
never executed: ok = 0 ;
0
1487 if (close (dir_fd) != 0
close (dir_fd) != 0Description
TRUEnever evaluated
FALSEevaluated 13 times by 1 test
Evaluated by:
  • shred
)
0-13
1488 {-
1489 error (0, -
1490 (*__errno_location ())-
1491 , -
1492 dcgettext (((void *)0), -
1493 "%s: failed to close"-
1494 , 5)-
1495 , qdir);-
1496 ok = -
1497 0-
1498 ;-
1499 }
never executed: end of block
0
1500 }
executed 13 times by 1 test: end of block
Executed by:
  • shred
13
1501 free (newname);-
1502 free (dir);-
1503 free (qdir);-
1504 return
executed 15 times by 1 test: return ok;
Executed by:
  • shred
ok;
executed 15 times by 1 test: return ok;
Executed by:
  • shred
15
1505}-
1506static -
1507 _Bool-
1508-
1509wipefile (char *name, char const *qname,-
1510 struct randint_source *s, struct Options const *flags)-
1511{-
1512 -
1513 _Bool -
1514 ok;-
1515 int fd;-
1516-
1517 fd = open_safer (name, -
1518 01 -
1519 | -
1520 0400 -
1521 | -
1522 0-
1523 );-
1524 if (fd < 0
fd < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • shred
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
1-25
1525 && (-
1526 (*
(*__errno_location ()) == 13Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
__errno_location ())
(*__errno_location ()) == 13Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-1
1527 ==
(*__errno_location ()) == 13Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-1
1528 13
(*__errno_location ()) == 13Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
0-1
1529 && flags->force
flags->forceDescription
TRUEnever evaluated
FALSEevaluated 1 time by 1 test
Evaluated by:
  • shred
)
0-1
1530 && chmod (name,
chmod (name, 0200 ) == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1531 0200
chmod (name, 0200 ) == 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1532 ) == 0
chmod (name, 0200 ) == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1533 fd = open_safer (name,
never executed: fd = open_safer (name, 01 | 0400 | 0 );
0
1534 01
never executed: fd = open_safer (name, 01 | 0400 | 0 );
0
1535 |
never executed: fd = open_safer (name, 01 | 0400 | 0 );
0
1536 0400
never executed: fd = open_safer (name, 01 | 0400 | 0 );
0
1537 |
never executed: fd = open_safer (name, 01 | 0400 | 0 );
0
1538 0
never executed: fd = open_safer (name, 01 | 0400 | 0 );
0
1539 );
never executed: fd = open_safer (name, 01 | 0400 | 0 );
0
1540 if (fd < 0
fd < 0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • shred
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
)
1-25
1541 {-
1542 error (0, -
1543 (*__errno_location ())-
1544 , -
1545 dcgettext (((void *)0), -
1546 "%s: failed to open for writing"-
1547 , 5)-
1548 , qname);-
1549 return
executed 1 time by 1 test: return 0 ;
Executed by:
  • shred
executed 1 time by 1 test: return 0 ;
Executed by:
  • shred
1
1550 0
executed 1 time by 1 test: return 0 ;
Executed by:
  • shred
1
1551 ;
executed 1 time by 1 test: return 0 ;
Executed by:
  • shred
1
1552 }-
1553-
1554 ok = do_wipefd (fd, qname, s, flags);-
1555 if (close (fd) != 0
close (fd) != 0Description
TRUEnever evaluated
FALSEevaluated 25 times by 1 test
Evaluated by:
  • shred
)
0-25
1556 {-
1557 error (0, -
1558 (*__errno_location ())-
1559 , -
1560 dcgettext (((void *)0), -
1561 "%s: failed to close"-
1562 , 5)-
1563 , qname);-
1564 ok = -
1565 0-
1566 ;-
1567 }
never executed: end of block
0
1568 if (ok
okDescription
TRUEevaluated 25 times by 1 test
Evaluated by:
  • shred
FALSEnever evaluated
&& flags->remove_file
flags->remove_fileDescription
TRUEevaluated 15 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 10 times by 1 test
Evaluated by:
  • shred
)
0-25
1569 ok = wipename (name, qname, flags);
executed 15 times by 1 test: ok = wipename (name, qname, flags);
Executed by:
  • shred
15
1570 return
executed 25 times by 1 test: return ok;
Executed by:
  • shred
ok;
executed 25 times by 1 test: return ok;
Executed by:
  • shred
25
1571}-
1572-
1573-
1574-
1575static struct randint_source *randint_source;-
1576-
1577-
1578-
1579-
1580static void-
1581clear_random_data (void)-
1582{-
1583 randint_all_free (randint_source);-
1584}
executed 24 times by 1 test: end of block
Executed by:
  • shred
24
1585-
1586-
1587int-
1588main (int argc, char **argv)-
1589{-
1590 -
1591 _Bool -
1592 ok = -
1593 1-
1594 ;-
1595 struct Options flags = { 0, };-
1596 char **file;-
1597 int n_files;-
1598 int c;-
1599 int i;-
1600 char const *random_source = -
1601 ((void *)0)-
1602 ;-
1603-
1604 ;-
1605 set_program_name (argv[0]);-
1606 setlocale (-
1607 6-
1608 , "");-
1609 bindtextdomain ("coreutils", "/usr/local/share/locale");-
1610 textdomain ("coreutils");-
1611-
1612 atexit (close_stdout);-
1613-
1614 flags.n_iterations = DEFAULT_PASSES;-
1615 flags.size = -1;-
1616-
1617 while ((
(c = getopt_lo... *)0) )) != -1Description
TRUEevaluated 87 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 24 times by 1 test
Evaluated by:
  • shred
c = getopt_long (argc, argv, "fn:s:uvxz", long_opts,
(c = getopt_lo... *)0) )) != -1Description
TRUEevaluated 87 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 24 times by 1 test
Evaluated by:
  • shred
24-87
1618 ((void *)0)
(c = getopt_lo... *)0) )) != -1Description
TRUEevaluated 87 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 24 times by 1 test
Evaluated by:
  • shred
24-87
1619 )) != -1
(c = getopt_lo... *)0) )) != -1Description
TRUEevaluated 87 times by 1 test
Evaluated by:
  • shred
FALSEevaluated 24 times by 1 test
Evaluated by:
  • shred
)
24-87
1620 {-
1621 switch (c)-
1622 {-
1623 case
executed 2 times by 1 test: case 'f':
Executed by:
  • shred
'f':
executed 2 times by 1 test: case 'f':
Executed by:
  • shred
2
1624 flags.force = -
1625 1-
1626 ;-
1627 break;
executed 2 times by 1 test: break;
Executed by:
  • shred
2
1628-
1629 case
executed 15 times by 1 test: case 'n':
Executed by:
  • shred
'n':
executed 15 times by 1 test: case 'n':
Executed by:
  • shred
15
1630 flags.n_iterations = xdectoumax (optarg, 0,-
1631 -
1632 ((((0x7fffffffffffffffL * 2UL + 1UL))<((18446744073709551615UL) -
1633 / sizeof (int)-
1634 ))?((0x7fffffffffffffffL * 2UL + 1UL)):((18446744073709551615UL) -
1635 / sizeof (int)-
1636 ))-
1637 -
1638 , "",-
1639 -
1640 dcgettext (((void *)0), -
1641 "invalid number of passes"-
1642 , 5)-
1643 , 0);-
1644 break;
executed 13 times by 1 test: break;
Executed by:
  • shred
13
1645-
1646 case
executed 2 times by 1 test: case RANDOM_SOURCE_OPTION:
Executed by:
  • shred
RANDOM_SOURCE_OPTION:
executed 2 times by 1 test: case RANDOM_SOURCE_OPTION:
Executed by:
  • shred
2
1647 if (random_source
random_sourceDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • shred
&& !(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0-2
1648 __extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1649 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1650 ) && __builtin_constant_p (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1651 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1652 ) && (__s1_len = __builtin_strlen (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1653 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1654 ), __s2_len = __builtin_strlen (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1655 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1656 ), (!((size_t)(const void *)((
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1657 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1658 ) + 1) - (size_t)(const void *)(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1659 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1660 ) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1661 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1662 ) + 1) - (size_t)(const void *)(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1663 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1664 ) == 1) || __s2_len >= 4)) ? __builtin_strcmp (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1665 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1666 ,
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1667 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1668 ) : (__builtin_constant_p (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1669 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1670 ) && ((size_t)(const void *)((
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1671 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1672 ) + 1) - (size_t)(const void *)(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1673 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1674 ) == 1) && (__s1_len = __builtin_strlen (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1675 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1676 ), __s1_len < 4) ? (__builtin_constant_p (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1677 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1678 ) && ((size_t)(const void *)((
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1679 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1680 ) + 1) - (size_t)(const void *)(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1681 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1682 ) == 1) ? __builtin_strcmp (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1683 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1684 ,
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1685 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1686 ) : (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1687 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1688 ); int __result = (((const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1689 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1690 ))[0] - __s2[0]); if (__s1_len > 0
__s1_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1691 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1692 ))[1] - __s2[1]); if (__s1_len > 1
__s1_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1693 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1694 ))[2] - __s2[2]); if (__s1_len > 2
__s1_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( random_source ))[3] - __s2[3]);
0
1695 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
never executed: __result = (((const unsigned char *) (const char *) ( random_source ))[3] - __s2[3]);
0
1696 ))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1697 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1698 ) && ((size_t)(const void *)((
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1699 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1700 ) + 1) - (size_t)(const void *)(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1701 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1702 ) == 1) && (__s2_len = __builtin_strlen (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1703 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1704 ), __s2_len < 4) ? (__builtin_constant_p (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1705 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1706 ) && ((size_t)(const void *)((
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1707 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1708 ) + 1) - (size_t)(const void *)(
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1709 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1710 ) == 1) ? __builtin_strcmp (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1711 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1712 ,
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1713 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1714 ) : -(__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1715 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1716 ); int __result = (((const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1717 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1718 ))[0] - __s2[0]); if (__s2_len > 0
__s2_len > 0Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1719 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1720 ))[1] - __s2[1]); if (__s2_len > 1
__s2_len > 1Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) { __result = (((const unsigned char *) (const char *) (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1721 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1722 ))[2] - __s2[2]); if (__s2_len > 2
__s2_len > 2Description
TRUEnever evaluated
FALSEnever evaluated
&& __result == 0
__result == 0Description
TRUEnever evaluated
FALSEnever evaluated
) __result = (((const unsigned char *) (const char *) (
never executed: __result = (((const unsigned char *) (const char *) ( optarg ))[3] - __s2[3]);
0
1723 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
never executed: __result = (((const unsigned char *) (const char *) ( optarg ))[3] - __s2[3]);
0
1724 ))[3] - __s2[3]); } } __result; }))) : __builtin_strcmp (
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1725 random_source
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1726 ,
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1727 optarg
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1728 )))); })
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
0
1729 == 0)
!( __extension...)))); }) == 0)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
1730 ((
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
!!sizeof (struct { _Static_assert (
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1731 1
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1732 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error (
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1733 1
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1734 , 0,
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1735 dcgettext (((void *)0),
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1736 "multiple random sources specified"
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1737 , 5)
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1738 ), ((
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1739 0
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1740 ) ? (void) 0 : __builtin_unreachable ()))) : ((error (
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1741 1
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1742 , 0,
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1743 dcgettext (((void *)0),
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1744 "multiple random sources specified"
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1745 , 5)
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1746 ), ((
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1747 0
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1748 ) ? (void) 0 : __builtin_unreachable ()))));
never executed: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"multiple random sources specified\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "multiple random sources specified" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))));
0
1749 random_source = optarg;-
1750 break;
executed 2 times by 1 test: break;
Executed by:
  • shred
2
1751-
1752 case
executed 17 times by 1 test: case 'u':
Executed by:
  • shred
'u':
executed 17 times by 1 test: case 'u':
Executed by:
  • shred
17
1753 if (optarg ==
optarg == ((void *)0)Description
TRUEevaluated 13 time