diff --git a/src/dir_walker.rs b/src/dir_walker.rs index 10722ea..701e51e 100644 --- a/src/dir_walker.rs +++ b/src/dir_walker.rs @@ -206,10 +206,6 @@ fn walk(dir: PathBuf, walk_data: &WalkData, depth: usize) -> Option { let prog_data = &walk_data.progress_data; let errors = &walk_data.errors; - if errors.lock().unwrap().abort { - return None; - } - let children = if dir.is_dir() { let read_dir = fs::read_dir(&dir); match read_dir { diff --git a/src/main.rs b/src/main.rs index 0a976eb..594cad1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,8 +26,6 @@ use std::panic; use std::process; use std::sync::Arc; use std::sync::Mutex; -use std::sync::atomic::AtomicBool; -use std::sync::atomic::Ordering; use sysinfo::{System, SystemExt}; use utils::canonicalize_absolute_path; @@ -119,20 +117,13 @@ fn main() { let errors = RuntimeErrors::default(); let error_listen_for_ctrlc = Arc::new(Mutex::new(errors)); let errors_for_rayon = error_listen_for_ctrlc.clone(); - let errors_final = error_listen_for_ctrlc.clone(); - let is_in_listing = Arc::new(AtomicBool::new(false)); - let cloned_is_in_listing = Arc::clone(&is_in_listing); ctrlc::set_handler(move || { - error_listen_for_ctrlc.lock().unwrap().abort = true; println!("\nAborting"); - if cloned_is_in_listing.load(Ordering::Relaxed) { - process::exit(1); - } + process::exit(1); }) .expect("Error setting Ctrl-C handler"); - is_in_listing.store(true, Ordering::Relaxed); let target_dirs = match config.get_files_from(&options) { Some(path) => { if path == "-" { @@ -162,7 +153,6 @@ fn main() { None => vec![".".to_owned()], }, }; - is_in_listing.store(false, Ordering::Relaxed); let summarize_file_types = options.get_flag("types"); @@ -304,10 +294,6 @@ fn main() { // Must have stopped indicator before we print to stderr indicator.stop(); - if errors_final.lock().unwrap().abort { - return; - } - let final_errors = walk_data.errors.lock().unwrap(); if !final_errors.file_not_found.is_empty() { let err = final_errors diff --git a/src/progress.rs b/src/progress.rs index 22185ec..fd37b92 100644 --- a/src/progress.rs +++ b/src/progress.rs @@ -79,7 +79,6 @@ pub struct RuntimeErrors { pub file_not_found: HashSet, pub unknown_error: HashSet, pub interrupted_error: i32, - pub abort: bool, } /* -------------------------------------------------------------------------- */