Skip to content

Commit 2da9f08

Browse files
committed
shred: exit immediately on read/write errors
1 parent f82b364 commit 2da9f08

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/uu/shred/src/shred.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,8 @@ fn wipe_file(
539539
}
540540
// size is an optional argument for exactly how many bytes we want to shred
541541
// Ignore failed writes; just keep trying
542-
show_if_err!(
543-
do_pass(&mut file, &pass_type, exact, random_source, size)
544-
.map_err_context(|| format!("{}: File write pass failed", path.maybe_quote()))
545-
);
542+
do_pass(&mut file, &pass_type, exact, random_source, size)
543+
.map_err_context(|| format!("{}: File write pass failed", path.maybe_quote()))?;
546544
}
547545

548546
if remove_method != RemoveMethod::None {
@@ -676,7 +674,6 @@ fn do_remove(
676674

677675
#[cfg(test)]
678676
mod tests {
679-
680677
use crate::{BLOCK_SIZE, OPTIMAL_IO_BLOCK_SIZE, split_on_blocks};
681678

682679
#[test]

tests/by-util/test_shred.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ fn test_random_source_regular_file() {
277277
}
278278

279279
#[test]
280-
#[ignore = "known issue #7947"]
281280
fn test_random_source_dir() {
282281
let scene = TestScenario::new(util_name!());
283282
let at = &scene.fixtures;

0 commit comments

Comments
 (0)