diff options
author | Igor Ostapenko <igoro@FreeBSD.org> | 2024-10-16 16:24:54 +0000 |
---|---|---|
committer | Igor Ostapenko <igoro@FreeBSD.org> | 2024-10-16 16:24:54 +0000 |
commit | b3e7d4b67ce653bcdd9ec671cfdcdfed58a0ea50 (patch) | |
tree | e95ebe46f94905be3f84a5d51cd42b0ec67a20f0 | |
parent | 2926c2594249f64fecbbdcb0b0b9a3591931ab04 (diff) | |
download | src-b3e7d4b67ce6.tar.gz src-b3e7d4b67ce6.zip |
tests: Fix style of netpfil/common/divapp.c
No functional change intended.
Reviewed by: markj
Approved by: markj (mentor)
Differential Revision: https://reviews.freebsd.org/D47132
-rw-r--r-- | tests/sys/netpfil/common/divapp.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/sys/netpfil/common/divapp.c b/tests/sys/netpfil/common/divapp.c index f3e41f010fef..d0f4b345b14c 100644 --- a/tests/sys/netpfil/common/divapp.c +++ b/tests/sys/netpfil/common/divapp.c @@ -83,8 +83,8 @@ recv_pkt(struct context *c) s = select(c->fd + 1, &readfds, 0, 0, &timeout); if (s == -1) errx(EX_IOERR, "recv_pkt: select() errors."); - if (s != 1) // timeout - return -1; + if (s != 1) /* timeout */ + return (-1); c->pkt_n = recvfrom(c->fd, c->pkt, sizeof(c->pkt), 0, (struct sockaddr *) &c->sin, &c->sin_len); @@ -98,14 +98,11 @@ static void send_pkt(struct context *c) { ssize_t n; - char errstr[32]; n = sendto(c->fd, c->pkt, c->pkt_n, 0, (struct sockaddr *) &c->sin, c->sin_len); - if (n == -1) { - strerror_r(errno, errstr, sizeof(errstr)); - errx(EX_IOERR, "send_pkt: sendto() errors: %d %s.", errno, errstr); - } + if (n == -1) + err(EX_IOERR, "send_pkt: sendto() errors"); if (n != c->pkt_n) errx(EX_IOERR, "send_pkt: sendto() sent %zd of %zd bytes.", n, c->pkt_n); @@ -145,5 +142,5 @@ main(int argc, char *argv[]) if (npkt != 1) errx(EXIT_FAILURE, "%d: npkt=%d.", c.divert_port, npkt); - return EXIT_SUCCESS; + return (EXIT_SUCCESS); } |