git: ec68cb077be1 - stable/13 - sendfile_test: fix copy-paste bug

From: Eric van Gyzen <vangyzen_at_FreeBSD.org>
Date: Wed, 02 Mar 2022 21:57:30 UTC
The branch stable/13 has been updated by vangyzen:

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

commit ec68cb077be136c2a082701fdefc50620e151605
Author:     Eric van Gyzen <vangyzen@FreeBSD.org>
AuthorDate: 2022-02-24 22:53:03 +0000
Commit:     Eric van Gyzen <vangyzen@FreeBSD.org>
CommitDate: 2022-03-02 21:56:31 +0000

    sendfile_test: fix copy-paste bug
    
    Require the newly opened file descriptor to be good, instead of
    re-requiring the one that was required three lines earlier.
    Thankfully, opening /dev/null is really unlikely to fail.
    
    Reported by:    Coverity
    MFC after:      1 week
    Sponsored by:   Dell EMC Isilon
    
    (cherry picked from commit a8fea07c3053293f35e00b9073b33ff6f1d9a067)
---
 lib/libc/tests/sys/sendfile_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libc/tests/sys/sendfile_test.c b/lib/libc/tests/sys/sendfile_test.c
index c12e4f7c1de3..0a205f2bb1d1 100644
--- a/lib/libc/tests/sys/sendfile_test.c
+++ b/lib/libc/tests/sys/sendfile_test.c
@@ -1062,7 +1062,7 @@ ATF_TC_BODY(s_negative_not_socket_file_descriptor, tc)
 	ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
 
 	client_sock = open(_PATH_DEVNULL, O_WRONLY);
-	ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno));
+	ATF_REQUIRE_MSG(client_sock != -1, "open failed: %s", strerror(errno));
 
 	error = sendfile(fd, client_sock, 0, 0, NULL, NULL, SF_FLAGS(0, 0));
 	ATF_REQUIRE_ERRNO(ENOTSOCK, error == -1);