Bug 31094

Summary: show more precision in fetch % complete
Product: Base System Reporter: Greg Moncreaff <moncrg>
Component: binAssignee: Dag-Erling Smørgrav <des>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Greg Moncreaff 2001-10-07 05:20:01 UTC
with large downloads on slow connection the fetch % complete
doesn't update meaninfully

Fix: cvs diff -u fetch.c
Comment 1 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2001-10-07 19:40:02 UTC
Responsible Changed
From-To: freebsd-bugs->des

fetch(1) is mine.
Comment 2 des 2001-10-07 19:43:20 UTC
Greg Moncreaff <moncrg@ma.ultranet.com> writes:
> @@ -129,8 +129,8 @@
>      if (xs->size <= 0)
>         fprintf(stderr, ": %lld bytes", xs->rcvd);
>      else
> -       fprintf(stderr, " (%lld bytes): %d%%", xs->size,
> -               (int)((100.0 * xs->rcvd) / xs->size));
> +       fprintf(stderr, " (%lld bytes): %3.1f%%", xs->size,
> +               (float)((100.0 * xs->rcvd) / xs->size));
>  }

The cast to float is not only unnecessary but meaningless, since
fprintf() is a vararg function, which means that the float is promoted
back to double anyway.  The width specifier in the format string is
also unnecessary.

DES
-- 
Dag-Erling Smorgrav - des@ofug.org
Comment 3 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2001-10-16 13:31:30 UTC
State Changed
From-To: open->closed

I'd rather keep it the way it is.  Fetch already has a SIGINFO handler for 
the impatient.