git: ac52fa1f1b97 - main - sendfile tests: Fix an error check in tcp_socketpair()

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Fri, 21 Jun 2024 18:21:57 UTC
The branch main has been updated by markj:

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

commit ac52fa1f1b9768d281b9deed6d1158f43a8564ca
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-06-21 18:18:22 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-06-21 18:18:22 +0000

    sendfile tests: Fix an error check in tcp_socketpair()
    
    Fixes:  c368d3f20fc0 ("tests/sendfile: factor out tcp_socketpair()")
    Differential Revision:  https://reviews.freebsd.org/D45598
---
 tests/sys/kern/sendfile_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/sys/kern/sendfile_helper.c b/tests/sys/kern/sendfile_helper.c
index 703b04fdea6c..6365531e312c 100644
--- a/tests/sys/kern/sendfile_helper.c
+++ b/tests/sys/kern/sendfile_helper.c
@@ -84,7 +84,7 @@ tcp_socketpair(int *sv)
 	if (fcntl(sv[0], F_SETFL, flags) == -1)
 		err(1, "fcntl +O_NONBLOCK");
 
-	if (connect(sv[0], (void *)&sin, sizeof(sin)) != -1 ||
+	if (connect(sv[0], (void *)&sin, sizeof(sin)) == -1 &&
 	    errno != EINPROGRESS)
 		err(1, "connect cs");