Skip to content
Myr

--exec: Do not exit on errors

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by David Peter · parent 046b057 · Browse files · 1 file+7 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−8 removed

  • other:+7 added−8 removed

1 file+7 added−8 removed

modified:src/exec/job.rs+7 added-8 removed
5 unmodified lines
6// notice may not be copied, modified, or distributed except7// according to those terms.89use super::CommandTemplate;10use internal::print_error_and_exit;10use internal::print_error;11use std::path::PathBuf;12use std::sync::mpsc::Receiver;13use std::sync::{Arc, Mutex};14use walk::WorkerResult;
9 unmodified lines
24 loop {25 // Create a lock on the shared receiver for this thread.26 let lock = rx.lock().unwrap();2728 // Obtain the next path from the receiver, else if the channel28 // Obtain the next result from the receiver, else if the channel29 // has closed, exit from the loop30 let value: PathBuf = match lock.recv() {31 Ok(value) => match value {32 WorkerResult::Entry(val) => val,33 WorkerResult::Error(err) => {34 print_error_and_exit(&format!("{}", err));35 }36 },31 Ok(WorkerResult::Entry(val)) => val,32 Ok(WorkerResult::Error(err)) => {33 print_error(&format!("{}", err));34 continue;35 }36 Err(_) => break,37 };3839 // Drop the lock so that other threads can read from the the receiver.
5 unmodified lines