diff options
author | bsiegert <bsiegert@pkgsrc.org> | 2015-07-04 16:11:53 +0000 |
---|---|---|
committer | bsiegert <bsiegert@pkgsrc.org> | 2015-07-04 16:11:53 +0000 |
commit | c0537c5fe7ceddbbcc1e48c66371810ca88eb913 (patch) | |
tree | c8f7142404a47f1cb4b43774573e75da423d7d9b /benchmarks/ttcp/patches | |
parent | a011111a5f469a1161f08d7eded3b0933268bf62 (diff) | |
download | pkgsrc-c0537c5fe7ceddbbcc1e48c66371810ca88eb913.tar.gz |
Use 1000-based units for line speeds. From Anders Magnusson in
PR pkg/22102, in 2003.
Diffstat (limited to 'benchmarks/ttcp/patches')
-rw-r--r-- | benchmarks/ttcp/patches/patch-ab | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/benchmarks/ttcp/patches/patch-ab b/benchmarks/ttcp/patches/patch-ab index 0681aa14f06..719f62d555d 100644 --- a/benchmarks/ttcp/patches/patch-ab +++ b/benchmarks/ttcp/patches/patch-ab @@ -1,10 +1,10 @@ -$NetBSD: patch-ab,v 1.9 2013/12/17 15:05:23 tron Exp $ +$NetBSD: patch-ab,v 1.10 2015/07/04 16:11:53 bsiegert Exp $ Fix build. --- ttcp.c.orig 1997-02-27 21:30:23.000000000 +0000 -+++ ttcp.c 2005-12-21 11:40:39.000000000 +0000 -@@ -44,17 +44,19 @@ ++++ ttcp.c +@@ -44,17 +44,19 @@ static char RCSid[] = "ttcp.c $Revision: /* #define BSD41a */ /* #define SYSV */ /* required on SGI IRIX releases before 3.3 */ @@ -28,7 +28,7 @@ Fix build. #if defined(SYSV) #include <sys/times.h> -@@ -71,7 +73,8 @@ +@@ -71,7 +73,8 @@ struct sockaddr_in sinme; struct sockaddr_in sinhim; struct sockaddr_in frominet; @@ -38,7 +38,7 @@ Fix build. int fd; /* fd of network socket */ int buflen = 8 * 1024; /* length of buffer */ -@@ -99,7 +102,6 @@ +@@ -99,7 +102,6 @@ char fmt = 'K'; /* output format: k = int touchdata = 0; /* access data after reading */ struct hostent *addr; @@ -46,7 +46,7 @@ Fix build. extern int optind; extern char *optarg; -@@ -151,7 +153,7 @@ +@@ -151,7 +153,7 @@ main(argc,argv) int argc; char **argv; { @@ -55,7 +55,7 @@ Fix build. int c; if (argc < 2) goto usage; -@@ -263,29 +265,30 @@ +@@ -263,29 +265,30 @@ char **argv; if ( (buf = (char *)malloc(buflen+bufalign)) == (char *)NULL) err("malloc"); if (bufalign != 0) @@ -93,7 +93,7 @@ Fix build. err("bind"); #if defined(SO_SNDBUF) || defined(SO_RCVBUF) -@@ -326,7 +329,7 @@ +@@ -326,7 +329,7 @@ char **argv; mes("nodelay"); } #endif @@ -102,7 +102,7 @@ Fix build. err("connect"); mes("connect"); } else { -@@ -348,11 +351,11 @@ +@@ -348,11 +351,11 @@ char **argv; } fromlen = sizeof(frominet); domain = AF_INET; @@ -117,7 +117,7 @@ Fix build. &peerlen) < 0) { err("getpeername"); } -@@ -412,25 +415,25 @@ +@@ -412,25 +415,25 @@ char **argv; } if( cput <= 0.0 ) cput = 0.001; if( realt <= 0.0 ) realt = 0.001; @@ -148,7 +148,24 @@ Fix build. "ttcp%s: buffer address %#x\n", trans?"-t":"-r", buf); -@@ -749,10 +752,10 @@ +@@ -488,13 +491,13 @@ double b; + sprintf(obuf, "%.2f MB", b / 1024.0 / 1024.0); + break; + case 'g': +- sprintf(obuf, "%.2f Gbit", b * 8.0 / 1024.0 / 1024.0 / 1024.0); ++ sprintf(obuf, "%.2f Gbit", b * 8.0 / 1000.0 / 1000.0 / 1000.0); + break; + case 'k': +- sprintf(obuf, "%.2f Kbit", b * 8.0 / 1024.0); ++ sprintf(obuf, "%.2f Kbit", b * 8.0 / 1000.0); + break; + case 'm': +- sprintf(obuf, "%.2f Mbit", b * 8.0 / 1024.0 / 1024.0); ++ sprintf(obuf, "%.2f Mbit", b * 8.0 / 1000.0 / 1000.0); + break; + } + return obuf; +@@ -749,10 +752,10 @@ void *buf; int count; { struct sockaddr_in from; @@ -161,7 +178,7 @@ Fix build. numCalls++; } else { if( b_flag ) -@@ -782,7 +785,7 @@ +@@ -782,7 +785,7 @@ int count; register int cnt; if( udp ) { again: @@ -170,7 +187,7 @@ Fix build. numCalls++; if( cnt<0 && errno == ENOBUFS ) { delay(18000); -@@ -803,7 +806,7 @@ +@@ -803,7 +806,7 @@ delay(us) tv.tv_sec = 0; tv.tv_usec = us; |