mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
dd: status=progress rewrites once/sec
This commit is contained in:
parent
f27f827751
commit
3842ecb1b4
1 changed files with 5 additions and 1 deletions
|
@ -832,10 +832,14 @@ fn gen_prog_updater(rx: mpsc::Receiver<ProgUpdate>, print_level: Option<StatusLe
|
|||
}
|
||||
});
|
||||
|
||||
let mut progress_as_secs = 0;
|
||||
while let Ok(update) = rx.recv() {
|
||||
// (Re)print status line if progress is requested.
|
||||
if Some(StatusLevel::Progress) == print_level {
|
||||
if Some(StatusLevel::Progress) == print_level
|
||||
&& update.duration.as_secs() >= progress_as_secs
|
||||
{
|
||||
reprint_prog_line(&update);
|
||||
progress_as_secs = update.duration.as_secs() + 1;
|
||||
}
|
||||
// Handle signals
|
||||
#[cfg(target_os = "linux")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue