summaryrefslogtreecommitdiff
path: root/benchmarks/ttcp/patches/patch-ab
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>2005-12-21 11:49:51 +0000
committertron <tron@pkgsrc.org>2005-12-21 11:49:51 +0000
commite30b8f0e48b87930b748eab06beaa86d7d071b1e (patch)
treeb1359392bb553e4ad42f66d995761ef67c64be9d /benchmarks/ttcp/patches/patch-ab
parent84ddbdcecb5e35fafcfe500b153cc9fb7edcd559 (diff)
downloadpkgsrc-e30b8f0e48b87930b748eab06beaa86d7d071b1e.tar.gz
- Fix GCC 4.x build problems.
- Correct crude Darwin build fix so it doesn't break under 8.x.
Diffstat (limited to 'benchmarks/ttcp/patches/patch-ab')
-rw-r--r--benchmarks/ttcp/patches/patch-ab59
1 files changed, 45 insertions, 14 deletions
diff --git a/benchmarks/ttcp/patches/patch-ab b/benchmarks/ttcp/patches/patch-ab
index 264a3c9c1c9..f2a35c0d1d7 100644
--- a/benchmarks/ttcp/patches/patch-ab
+++ b/benchmarks/ttcp/patches/patch-ab
@@ -1,16 +1,42 @@
-$NetBSD: patch-ab,v 1.7 2005/12/05 20:49:51 rillig Exp $
+$NetBSD: patch-ab,v 1.8 2005/12/21 11:49:51 tron Exp $
--- ttcp.c.orig 1997-02-27 21:30:23.000000000 +0000
-+++ ttcp.c
-@@ -55,6 +55,7 @@
++++ ttcp.c 2005-12-21 11:40:39.000000000 +0000
+@@ -44,17 +44,19 @@
+ /* #define BSD41a */
+ /* #define SYSV */ /* required on SGI IRIX releases before 3.3 */
+
+-#include <stdio.h>
+-#include <signal.h>
+-#include <ctype.h>
+-#include <errno.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <netinet/tcp.h>
#include <arpa/inet.h>
++#include <stdio.h>
++#include <signal.h>
++#include <ctype.h>
++#include <errno.h>
#include <netdb.h>
#include <sys/time.h> /* struct timeval */
+#include <stdlib.h>
++#include <string.h>
#if defined(SYSV)
#include <sys/times.h>
-@@ -99,7 +100,6 @@ char fmt = 'K'; /* output format: k =
+@@ -71,7 +73,8 @@
+ struct sockaddr_in sinhim;
+ struct sockaddr_in frominet;
+
+-int domain, fromlen;
++int domain;
++socklen_t fromlen;
+ int fd; /* fd of network socket */
+
+ int buflen = 8 * 1024; /* length of buffer */
+@@ -99,7 +102,6 @@
int touchdata = 0; /* access data after reading */
struct hostent *addr;
@@ -18,7 +44,7 @@ $NetBSD: patch-ab,v 1.7 2005/12/05 20:49:51 rillig Exp $
extern int optind;
extern char *optarg;
-@@ -151,7 +151,7 @@ main(argc,argv)
+@@ -151,7 +153,7 @@
int argc;
char **argv;
{
@@ -27,7 +53,7 @@ $NetBSD: patch-ab,v 1.7 2005/12/05 20:49:51 rillig Exp $
int c;
if (argc < 2) goto usage;
-@@ -263,29 +263,30 @@ char **argv;
+@@ -263,29 +265,30 @@
if ( (buf = (char *)malloc(buflen+bufalign)) == (char *)NULL)
err("malloc");
if (bufalign != 0)
@@ -65,7 +91,7 @@ $NetBSD: patch-ab,v 1.7 2005/12/05 20:49:51 rillig Exp $
err("bind");
#if defined(SO_SNDBUF) || defined(SO_RCVBUF)
-@@ -326,7 +327,7 @@ char **argv;
+@@ -326,7 +329,7 @@
mes("nodelay");
}
#endif
@@ -74,7 +100,7 @@ $NetBSD: patch-ab,v 1.7 2005/12/05 20:49:51 rillig Exp $
err("connect");
mes("connect");
} else {
-@@ -348,11 +349,11 @@ char **argv;
+@@ -348,11 +351,11 @@
}
fromlen = sizeof(frominet);
domain = AF_INET;
@@ -82,13 +108,14 @@ $NetBSD: patch-ab,v 1.7 2005/12/05 20:49:51 rillig Exp $
+ if((fd=accept(fd, (struct sockaddr *)&frominet, &fromlen) ) < 0)
err("accept");
{ struct sockaddr_in peer;
- int peerlen = sizeof(peer);
+- int peerlen = sizeof(peer);
- if (getpeername(fd, (struct sockaddr_in *) &peer,
++ socklen_t peerlen = sizeof(peer);
+ if (getpeername(fd, (struct sockaddr *) &peer,
&peerlen) < 0) {
err("getpeername");
}
-@@ -412,25 +413,25 @@ char **argv;
+@@ -412,25 +415,25 @@
}
if( cput <= 0.0 ) cput = 0.001;
if( realt <= 0.0 ) realt = 0.001;
@@ -119,8 +146,12 @@ $NetBSD: patch-ab,v 1.7 2005/12/05 20:49:51 rillig Exp $
"ttcp%s: buffer address %#x\n",
trans?"-t":"-r",
buf);
-@@ -752,7 +753,7 @@ int count;
- int len = sizeof(from);
+@@ -749,10 +752,10 @@
+ int count;
+ {
+ struct sockaddr_in from;
+- int len = sizeof(from);
++ socklen_t len = sizeof(from);
register int cnt;
if( udp ) {
- cnt = recvfrom( fd, buf, count, 0, &from, &len );
@@ -128,7 +159,7 @@ $NetBSD: patch-ab,v 1.7 2005/12/05 20:49:51 rillig Exp $
numCalls++;
} else {
if( b_flag )
-@@ -782,7 +783,7 @@ int count;
+@@ -782,7 +785,7 @@
register int cnt;
if( udp ) {
again:
@@ -137,7 +168,7 @@ $NetBSD: patch-ab,v 1.7 2005/12/05 20:49:51 rillig Exp $
numCalls++;
if( cnt<0 && errno == ENOBUFS ) {
delay(18000);
-@@ -803,7 +804,7 @@ delay(us)
+@@ -803,7 +806,7 @@
tv.tv_sec = 0;
tv.tv_usec = us;