summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-09-28 12:00:36 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-09-28 12:00:36 +0000
commit4823863b74461c5dcb42c7b322631a37d7659154 (patch)
treef2d97046bdea4de60555dfcb27dd7fc43ba8f152
parent8edd47916a1202c5ab3bc8fc728b344d80ab36b8 (diff)
Make -k work in clientmode by passing the right socket to the
stats_prepare() function.
-rw-r--r--usr.bin/tcpbench/tcpbench.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/tcpbench/tcpbench.c b/usr.bin/tcpbench/tcpbench.c
index 5ae4af080a4..fefff4c6da0 100644
--- a/usr.bin/tcpbench/tcpbench.c
+++ b/usr.bin/tcpbench/tcpbench.c
@@ -803,7 +803,7 @@ clientloop(kvm_t *kvmh, u_long ktcbtab, struct addrinfo *aitop, int nconn)
struct statctx *psc;
struct pollfd *pfd;
char *buf;
- int i, sock = -1;
+ int i;
ssize_t n;
if ((pfd = calloc(nconn, sizeof(*pfd))) == NULL)
@@ -814,7 +814,7 @@ clientloop(kvm_t *kvmh, u_long ktcbtab, struct addrinfo *aitop, int nconn)
clientconnect(aitop, pfd, nconn);
for (i = 0; i < nconn; i++) {
- stats_prepare(psc + i, sock, kvmh, ktcbtab);
+ stats_prepare(psc + i, pfd[i].fd, kvmh, ktcbtab);
mainstats.nconns++;
}
@@ -860,7 +860,6 @@ clientloop(kvm_t *kvmh, u_long ktcbtab, struct addrinfo *aitop, int nconn)
warnx("Terminated by signal %d", done);
free(buf);
- close(sock);
exit(0);
}