X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/193710981fb402fe275493df5ce9e2f36a238209..6ee561e363093043dfe51c762e8645c89a3f68b3:/usr/src/usr.bin/ftp/ftp.c diff --git a/usr/src/usr.bin/ftp/ftp.c b/usr/src/usr.bin/ftp/ftp.c index 39d3a285df..6f3ed61b2f 100644 --- a/usr/src/usr.bin/ftp/ftp.c +++ b/usr/src/usr.bin/ftp/ftp.c @@ -1,5 +1,5 @@ #ifndef lint -static char sccsid[] = "@(#)ftp.c 4.10 (Berkeley) %G%"; +static char sccsid[] = "@(#)ftp.c 4.12 (Berkeley) %G%"; #endif #include @@ -547,9 +547,6 @@ dataconn(mode) } (void) close(data); data = s; - if (*mode == 'w' && linger) - (void) setsockopt(s, SOL_SOCKET, SO_LINGER, &linger, - sizeof (linger)); return (fdopen(data, mode)); } @@ -559,15 +556,14 @@ ptransfer(direction, bytes, t0, t1) struct timeval *t0, *t1; { struct timeval td; - long ms; - float bs; + float s, bs; tvsub(&td, t1, t0); - ms = (td.tv_sec * 1000) + (td.tv_usec / 1000); + s = td.tv_sec + (td.tv_usec / 1000000.); #define nz(x) ((x) == 0 ? 1 : (x)) - bs = ((bytes * NBBY * 1000) / (float) nz(ms)) / NBBY; - printf("%ld bytes %s in %d.%02d seconds (%.2g Kbytes/s)\n", - bytes, direction, td.tv_sec, td.tv_usec / 10000, bs / 1024.); + bs = bytes / nz(s); + printf("%ld bytes %s in %.2g seconds (%.2g Kbytes/s)\n", + bytes, direction, s, bs / 1024.); } tvadd(tsum, t0)