Subject: bin/1470: ftp(1) prints bogus transfer times
To: None <gnats-bugs@gnats.netbsd.org>
From: None <thomas@mathematik.uni-Bremen.de>
List: netbsd-bugs
Date: 09/16/1995 17:15:03
>Number: 1470
>Category: bin
>Synopsis: ftp(1) prints bogus transfer times
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people (Utility Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Sep 16 11:20:02 1995
>Last-Modified:
>Originator: Thomas Eberhardt
>Organization:
CeVis, University of Bremen, Germany
>Release: NetBSD-current 950916
>Environment:
System: NetBSD ed209 1.0A NetBSD 1.0A (ED209) #2: Fri Sep 15 21:42:35 MET DST 1995 thomas@ed209:/usr/src/sys/arch/i386/compile/ED209 i386
Machine: i386
>Description:
ftp(1) uses timersub with arguments in the wrong order which
causes bogus transfer times to be printed.
>How-To-Repeat:
>Fix:
*** usr.bin/ftp/ftp.c- Tue Sep 12 09:12:17 1995
--- usr.bin/ftp/ftp.c Sat Sep 16 16:40:03 1995
***************
*** 1162,1168 ****
long bs;
if (verbose) {
! timersub(&td, t1, t0);
s = td.tv_sec + (td.tv_usec / 1000000.);
#define nz(x) ((x) == 0 ? 1 : (x))
bs = bytes / nz(s);
--- 1162,1168 ----
long bs;
if (verbose) {
! timersub(t1, t0, &td);
s = td.tv_sec + (td.tv_usec / 1000000.);
#define nz(x) ((x) == 0 ? 1 : (x))
bs = bytes / nz(s);
>Audit-Trail:
>Unformatted: