From nobody Wed Oct 16 16:25:59 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XTGYM28GLz5YjVC; Wed, 16 Oct 2024 16:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XTGYM1SmLz4hCh; Wed, 16 Oct 2024 16:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729095959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z15YWkR7dBz1iqhIgRVAq8vTlozFYZ9xzGzL/fTGhik=; b=bBHBIwiPoFM3imuQnb7t2I3cCMkgPBnR/hzYiLD/lXvWmiWXWOJ4u4ZnLXMyhaT6ugN8yV y7rfDANequP4/DmEAGAhKxQ21pBezmwwMyr6QO0J31m2kgAbPu0RKnfsxf2xHvHvP8KwUr KOVhMCBkTmwF8n3sejwMUiLsZQ8tK3dsSekPn3B5gzIADgASHMNT4T5lCw+udGfi9+Ob7X Sq4fs1/aQlwh+wo1nfBxRnbqwZosY/sMg2bJNGSlTeU1sX70vAlqFA2Pk4Q6y8E0SWFbqK NmvBT6S0/dJZj8co7+Xv+qh2GqW4cXuO42HuKg97gbUQPMveNSepEODexfDN6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729095959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z15YWkR7dBz1iqhIgRVAq8vTlozFYZ9xzGzL/fTGhik=; b=DTRqwNlnrJpHIffzC9W10PiuY0S62dDPKbq5EmtiloQ9DF3qcu/OF3H+NEQVCzEAtNNy1I 3+fZFzhbXNPUz9jEjiwMvR1CN+McDwwxrclDtMR6gPnSStFWN2oebSqIRq1P78ptxJF9YO WBcc4wn9Laft1TCoRUGUGeSQa7gShkoaGopMSVgPoNQFG48EVUEPk3PsifkA42qn3r+FyM +8V7rUuFSYHWCAN/cKz5uWP4wBCp/7jEXArUD8SHtsIx5liwT8658jBnv9Wrp8Vodp4lmY KNuDrOXNer1TlPiav5C8Az9lWNbms2x3ShzJMV+yVp2fhI4i5KHZ2g9jXGnKLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729095959; a=rsa-sha256; cv=none; b=MZnVmruThMp2nf6KgsjFU6G74QlftyC9Qpw8IdxHdnTD6+LYX4e7dIIciOqkzERFMZs5e9 TPnXW3TMiZ0hqA9w24MtE1e4vMvhQ39MGaLg1/Qutj9nSqnGMmnzmvmLF+sJ9m4yXFYzzl a2J+Ql/DMplRXG+XWCM6wcoMZSXd6Y9EPJhfUcuZQtjZ8nViGbB0mAFM4xdKw9oLswJPpJ Ap0OP8a0mt7UdkcTo/jlmdkhjR/rrIC7iPW/AZFTVhZNbo5DSrV7wpuE6Iin4wcLxKP7m6 MnW62mr5JyQgRPfqfnN1nJf+zJBm+gWFjvG7RLM81tFISIBu/ccVWlgUJnWe4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XTGYM0xgDz1Bvt; Wed, 16 Oct 2024 16:25:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49GGPxfu076810; Wed, 16 Oct 2024 16:25:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49GGPx6u076807; Wed, 16 Oct 2024 16:25:59 GMT (envelope-from git) Date: Wed, 16 Oct 2024 16:25:59 GMT Message-Id: <202410161625.49GGPx6u076807@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Igor Ostapenko Subject: git: b3e7d4b67ce6 - main - tests: Fix style of netpfil/common/divapp.c List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3e7d4b67ce653bcdd9ec671cfdcdfed58a0ea50 Auto-Submitted: auto-generated The branch main has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=b3e7d4b67ce653bcdd9ec671cfdcdfed58a0ea50 commit b3e7d4b67ce653bcdd9ec671cfdcdfed58a0ea50 Author: Igor Ostapenko AuthorDate: 2024-10-16 16:24:54 +0000 Commit: Igor Ostapenko CommitDate: 2024-10-16 16:24:54 +0000 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 --- tests/sys/netpfil/common/divapp.c | 13 +++++-------- 1 file 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); }