diff options
author | Eric van Gyzen <vangyzen@FreeBSD.org> | 2022-02-24 22:53:03 +0000 |
---|---|---|
committer | Eric van Gyzen <vangyzen@FreeBSD.org> | 2022-03-02 21:56:31 +0000 |
commit | ec68cb077be136c2a082701fdefc50620e151605 (patch) | |
tree | 15c81c4d0596d0402284fe49b78b6d5c75085355 /lib | |
parent | 5be8c23a343f1c4dc60a4b48e3e3832e146aaacb (diff) | |
download | src-ec68cb077be136c2a082701fdefc50620e151605.tar.gz src-ec68cb077be136c2a082701fdefc50620e151605.zip |
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)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/tests/sys/sendfile_test.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |