diff --git a/tools/test/stress2/testcases/socket/socket.c b/tools/test/stress2/testcases/socket/socket.c index 965ce6b852c..ec9b1e6cd28 100644 --- a/tools/test/stress2/testcases/socket/socket.c +++ b/tools/test/stress2/testcases/socket/socket.c @@ -47,15 +47,13 @@ static int sv[2]; static void reader(void) { - int n, t, *buf; + int n, *buf; - t = 0; if ((buf = malloc(bufsize)) == NULL) err(1, "malloc(%d), %s:%d", bufsize, __FILE__, __LINE__); while (done_testing == 0) { if ((n = read(sv[0], buf, bufsize)) < 0) err(1, "read(), %s:%d", __FILE__, __LINE__); - t += n; if (n == 0) break; } close(sv[0]); diff --git a/tools/test/stress2/testcases/tcp/tcp.c b/tools/test/stress2/testcases/tcp/tcp.c index 5d8d7197b5b..468acb169f4 100644 --- a/tools/test/stress2/testcases/tcp/tcp.c +++ b/tools/test/stress2/testcases/tcp/tcp.c @@ -52,7 +52,7 @@ reader(void) { struct sockaddr_in inetaddr, inetpeer; socklen_t len; int on; - int n, t, *buf; + int n, *buf; int tcpsock, msgsock; alarm(op->run_time + 30); @@ -85,13 +85,11 @@ reader(void) { (struct sockaddr *)&inetpeer, &len)) < 0) err(1, "accept(), %s:%d", __FILE__, __LINE__); - t = 0; if ((buf = malloc(bufsize)) == NULL) err(1, "malloc(%d), %s:%d", bufsize, __FILE__, __LINE__); while (done_testing == 0) { if ((n = read(msgsock, buf, bufsize)) < 0) err(1, "read(), %s:%d", __FILE__, __LINE__); - t += n; if (n == 0) break; } close(msgsock);