git: 0cf1002113b9 - main - tests/sys/kern/ssl_sendfile: fix the build with ATF 0.22+

From: Enji Cooper <ngie_at_FreeBSD.org>
Date: Sun, 06 Sep 2026 19:19:00 UTC
The branch main has been updated by ngie:

URL: https://cgit.FreeBSD.org/src/commit/?id=0cf1002113b90b74ac2c1973ca649632c8c7552a

commit 0cf1002113b90b74ac2c1973ca649632c8c7552a
Author:     Enji Cooper <ngie@FreeBSD.org>
AuthorDate: 2026-08-19 15:21:25 +0000
Commit:     Enji Cooper <ngie@FreeBSD.org>
CommitDate: 2026-09-06 19:18:26 +0000

    tests/sys/kern/ssl_sendfile: fix the build with ATF 0.22+
    
    Code that assigned variables as part of ATF_\* are no longer
    permitted due to changes introduced in [ATF 0.22][1].
    
    MFC after:      2 weeks
    Reported by:    clang/gcc (-Wparenthesis)
    Differential Revision:  https://reviews.freebsd.org/D59286
    
    [1]: https://github.com/freebsd/atf/pull/72
---
 tests/sys/kern/ssl_sendfile.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/tests/sys/kern/ssl_sendfile.c b/tests/sys/kern/ssl_sendfile.c
index c16640572bb1..3b93b3beef28 100644
--- a/tests/sys/kern/ssl_sendfile.c
+++ b/tests/sys/kern/ssl_sendfile.c
@@ -99,8 +99,10 @@ common_init(struct ctx *c)
 	SSL_library_init();
 	OpenSSL_add_all_algorithms();
 	SSL_load_error_strings();
-	ATF_REQUIRE(c->pkey = EVP_RSA_gen(2048));
-	ATF_REQUIRE(c->cert = X509_new());
+	c->pkey = EVP_RSA_gen(2048);
+	ATF_REQUIRE(c->pkey != NULL);
+	c->cert = X509_new();
+	ATF_REQUIRE(c->cert != NULL);
 	ASN1_INTEGER_set(X509_get_serialNumber(c->cert), 1);
 	X509_set_version(c->cert, 2);
 	X509_gmtime_adj(X509_get_notBefore(c->cert), 0);
@@ -142,10 +144,12 @@ common_init(struct ctx *c)
 	/*
 	 * Connect client.
 	 */
-	ATF_REQUIRE(c->ctx = SSL_CTX_new(TLS_client_method()));
+	c->ctx = SSL_CTX_new(TLS_client_method());
+	ATF_REQUIRE(c->ctx != NULL);
 	ATF_REQUIRE(X509_STORE_add_cert(SSL_CTX_get_cert_store(c->ctx),
 	    c->cert));
-	ATF_REQUIRE(ssl = c->cln = SSL_new(c->ctx));
+	ssl = c->cln = SSL_new(c->ctx);
+	ATF_REQUIRE(c->cln != NULL);
 	ATF_REQUIRE((c->cs = socket(AF_INET, SOCK_STREAM, 0)) > 0);
 	ATF_REQUIRE(connect(c->cs, (struct sockaddr *)&(struct sockaddr_in)
 	    { .sin_family = AF_INET, .sin_len = sizeof(struct sockaddr_in),
@@ -192,7 +196,8 @@ server_thread(void *arg) {
 	};
 	int s;
 
-	ATF_REQUIRE(srv = SSL_CTX_new(TLS_server_method()));
+	srv = SSL_CTX_new(TLS_server_method());
+	ATF_REQUIRE(srv != NULL);
 	ATF_REQUIRE(SSL_CTX_set_options(srv, SSL_OP_ENABLE_KTLS) &
 	    SSL_OP_ENABLE_KTLS);
 	SSL_CTX_use_PrivateKey(srv, c->pkey);