mirror of
https://github.com/opnsense/src.git
synced 2026-02-18 18:20:26 -05:00
stress2: Fix "set-but-not-unused" warnings
This commit is contained in:
parent
4bae154fe8
commit
9a6201ac2f
2 changed files with 2 additions and 6 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue