[SCM] The rsync repository. - branch master updated

Rsync CVS commit messages rsync-cvs at lists.samba.org
Thu Jan 13 16:26:31 UTC 2022


The branch, master has been updated
       via  6130c4fa Display ??:??:?? when a time estimate gets too big.
      from  8c4ceb3b Avoid a -8 in the progress output's remaining time

https://git.samba.org/?p=rsync.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6130c4fa3c92803d508f947e555fcd4e325f6178
Author: Wayne Davison <wayne at opencoder.net>
Date:   Thu Jan 13 08:11:50 2022 -0800

    Display ??:??:?? when a time estimate gets too big.

-----------------------------------------------------------------------

Summary of changes:
 NEWS.md    | 6 ++----
 progress.c | 6 +++---
 2 files changed, 5 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/NEWS.md b/NEWS.md
index 4eebaa44..959e1da7 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -88,10 +88,8 @@
    check to see if the allowed time is over, which should make rsync exit more
    consistently.
 
- - Tweak the snprintf() in progress.c that turns the remaining time into a
-   HHHH:MM:SS value to avoid putting a -8 into the SS or MM spots when the
-   remaining seconds is so large that it overflows the integer arithmetic
-   trying to perform a modulus.
+ - Tweak --progress to display "??:??:??" when the time-remaining value is
+   so large as to be meaningless.
 
 ### ENHANCEMENTS:
 
diff --git a/progress.c b/progress.c
index 6e39ce99..6af96b98 100644
--- a/progress.c
+++ b/progress.c
@@ -115,11 +115,11 @@ static void rprint_progress(OFF_T ofs, OFF_T size, struct timeval *now, int is_l
 		units = "kB/s";
 	}
 
-	if (remain < 0)
+	if (remain < 0 || remain > 9999.0 * 3600.0)
 		strlcpy(rembuf, "  ??:??:??", sizeof rembuf);
 	else {
-		snprintf(rembuf, sizeof rembuf, "%4lu:%02u:%02u",
-			 (unsigned long) (remain / 3600.0),
+		snprintf(rembuf, sizeof rembuf, "%4u:%02u:%02u",
+			 (unsigned int) (remain / 3600.0),
 			 (unsigned int) (remain / 60.0) % 60,
 			 (unsigned int) remain % 60);
 	}


-- 
The rsync repository.



More information about the rsync-cvs mailing list