git: 4e17a6f588df - stable/15 - tests/sys/netinet/tcp_socket: fix build with ATF 0.22+

From: Enji Cooper <ngie_at_FreeBSD.org>
Date: Sun, 01 Nov 2026 02:32:19 UTC
The branch stable/15 has been updated by ngie:

URL: https://cgit.FreeBSD.org/src/commit/?id=4e17a6f588dfa6edc8a798cda76b9388af11f412

commit 4e17a6f588dfa6edc8a798cda76b9388af11f412
Author:     Enji Cooper <ngie@FreeBSD.org>
AuthorDate: 2026-09-02 07:38:17 +0000
Commit:     Enji Cooper <ngie@FreeBSD.org>
CommitDate: 2026-11-01 02:31:58 +0000

    tests/sys/netinet/tcp_socket: fix build with ATF 0.22+
    
    Confirm that creating clients/sockets was successful by testing the
    result separate from the assignment and test that the return value is
    not -1 instead of testing that the value returned is non-zero.
    
    This fixes the build with [ATF 0.22+][1].
    
    MFC after:      2 weeks
    Reported by:    clang (-Wparenthesis)
    Reviewed by:    tuexen, cc
    Differential Revision:  https://reviews.freebsd.org/D59284
    [1]: https://github.com/freebsd/atf/pull/72
    
    Conflicts:
            tests/sys/netinet/tcp_implied_connect.c
    
    (cherry picked from commit 4aea6ea2eb400737837ff8d22c25688f88c7966c)
---
 tests/sys/netinet/tcp_implied_connect.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/sys/netinet/tcp_implied_connect.c b/tests/sys/netinet/tcp_implied_connect.c
index d03d6be4fb92..e81372e9d32d 100644
--- a/tests/sys/netinet/tcp_implied_connect.c
+++ b/tests/sys/netinet/tcp_implied_connect.c
@@ -45,8 +45,10 @@ ATF_TC_BODY(tcp_implied_connect, tc)
 	socklen_t len;
 	int s, c, a;
 
-	ATF_REQUIRE(s = socket(PF_INET, SOCK_STREAM, 0));
-	ATF_REQUIRE(c = socket(PF_INET, SOCK_STREAM, 0));
+	s = socket(PF_INET, SOCK_STREAM, 0);
+	ATF_REQUIRE(s != -1);
+	c = socket(PF_INET, SOCK_STREAM, 0);
+	ATF_REQUIRE(c != -1);
 
 	ATF_REQUIRE(bind(s, (struct sockaddr *)&sin, sizeof(sin)) == 0);
 	len = sizeof(sin);