mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
Merge pull request #3078 from ndd7xv/dd-progress-fix
dd: make status=progress rewrite once/sec
This commit is contained in:
commit
52282740dd
1 changed files with 5 additions and 1 deletions
|
@ -866,10 +866,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() {
|
while let Ok(update) = rx.recv() {
|
||||||
// (Re)print status line if progress is requested.
|
// (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);
|
reprint_prog_line(&update);
|
||||||
|
progress_as_secs = update.duration.as_secs() + 1;
|
||||||
}
|
}
|
||||||
// Handle signals
|
// Handle signals
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue