From nobody Thu Feb 24 23:05:38 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B734419E5447; Thu, 24 Feb 2022 23:05:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K4T5t3Svqz50N5; Thu, 24 Feb 2022 23:05:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645743938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KK1jf0n50LCLW31ai+N3Zf+P5AkE95GB6jyNZmLBffU=; b=cXDCKhHIzGSeMUGtyF6oK6EeYusdn3ECSvQjVWka1/k5SLRsgK+vlG5gBDyaMx5mjB/rNN 7MF347KCoHwNr1V6zLGxIxB8iPGag9mfx+8aA2BnpoXarycCf7Izmry1+mRwuwyFcq06rD 5E8/b1gHYstlV0qA8NEEt1UKtu4+G5S1nK4IBhvl/y07aRi9IX+vkSHkCZe/8OGIgLbJjH yw5+ZwcH6bgzIoJnpyEkfHO2gA96Nn+6U6dgKpUNMBGdaR+7sHEQV/KE0oNbAGdkTJVKBn Dg6wKgeHLyDW4irEbNZxWz+NLg9NXAArs/nClN7HqtVo0xygjaDfUFjpmlLzGw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5329714BAE; Thu, 24 Feb 2022 23:05:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 21ON5cJQ050840; Thu, 24 Feb 2022 23:05:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 21ON5c1V050839; Thu, 24 Feb 2022 23:05:38 GMT (envelope-from git) Date: Thu, 24 Feb 2022 23:05:38 GMT Message-Id: <202202242305.21ON5c1V050839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric van Gyzen Subject: git: a8fea07c3053 - main - sendfile_test: fix copy-paste bug List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: vangyzen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8fea07c3053293f35e00b9073b33ff6f1d9a067 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1645743938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KK1jf0n50LCLW31ai+N3Zf+P5AkE95GB6jyNZmLBffU=; b=iC+oCHqKiGMPUKsLZ0ov0t20ghWQIENh0VNY9N4vQkSf8f2ZfdNLCvoMiFmHRzYV8eEVc5 tUR9hv2iXncSjSgfc+KkbQJh5YafxsqTyST41VYDMnvqSiIpIdRZsl//ycLki5l4MLJB4B zrJiNGP9IAX6n1pN5WSyRAsSh8ZLYGq2jMZ+O4YWJldRGCmlbDtSgAioD/JN621n712DWO 92ZkJEVR2DpmUUJAZ574T5Z1Sh/rxTth4jEtjGuUCgPirgzmOIhm6hHjWhXflTNqDm88b2 PjEjg/jjfwUuwyJP+C5AkPtR4u/c2FAyb52WV3MAOWCLV99PlvL2gfQ3wX0n3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1645743938; a=rsa-sha256; cv=none; b=CoK2QH6/6CRKXlu+1x4Ynh+n0apczc+56lkyuXX/aOObXd2pq/1b+Qq+Wk0AsVFBT9VTQe ojbzCB50mi2uGnpFmADt6R9C3mSHnp63hCvdqnxOJkOetVpbB5kvjDwRxR6OtmR2Wv27h/ ePdzlOZPUPfWxvj57XTKnfsQCuezKiUzir2M51BStlLEdwJgPb1akkcQeMv37YckS9Jf6w 6Fe/3bMPWAGuGoumAZb8Vcy0LZzB2Gqxd/ugSfvCCf+Gl7002uux978EXd6WuYIlIV2TJg T3s98ZKs0i26O8UjrKrR87dGUo4JGARP04XLTmgO1hkqA2ZtMHmKcgdWhHca7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by vangyzen: URL: https://cgit.FreeBSD.org/src/commit/?id=a8fea07c3053293f35e00b9073b33ff6f1d9a067 commit a8fea07c3053293f35e00b9073b33ff6f1d9a067 Author: Eric van Gyzen AuthorDate: 2022-02-24 22:53:03 +0000 Commit: Eric van Gyzen CommitDate: 2022-02-24 23:05:12 +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 --- 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 1700691495c4..c8df110c2a96 100644 --- a/lib/libc/tests/sys/sendfile_test.c +++ b/lib/libc/tests/sys/sendfile_test.c @@ -1110,7 +1110,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);