From nobody Fri May 10 11:00:09 2024 X-Original-To: dev-commits-src-all@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 4VbQrn45fkz5JBBd; Fri, 10 May 2024 11:00:09 +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 4VbQrn3SRWz4PqD; Fri, 10 May 2024 11:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715338809; 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=UgFINXGWRiR8EgXeSfQM8lOxTQyum6m7P8nY0JOMb5I=; b=d+QzYQ1DLaj0Fhpl7dtjXJAlboaRwRPrSeqKgY7fTA67WSQVtmitQSVR25uoXW5/XIauWD 3Zq/exjaBmge9odbOS6jrbkV3l76INIdXVjNunZhXwxkjSVN1ZMlmlXquHPNl2GGMosbSV yq6/f0CMfxkuMnaZytpJUZpvzt1GBQzQFy4FGT8Vt294V3FZDfmbGZd+Wm6DtyxMb3QPoJ LXyji0waSXK/Y3/iGofpz0Rz4fObDyFnsSlJw59u7cpiL/XU85CFMwgRTYOYm2R1pcDF0q wM32L2fml66AB5RNGXPJlqQs2Iia3QQtRq0MrA7R2QgitP5ViEXXEPkZhSen6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715338809; a=rsa-sha256; cv=none; b=YMYUkrOdJr7MU9PS8OYRzVnqM6dmRmcSDp87njCoER0iPTuJuI7swUUodksa2Brk6zCAif Gcz5J39ZkHdo80M+miGW2geNhebjJwsBjPeM7lq4rKDUHWJDOSgeEHSJi6RmbaAO2mwo5y cpWlnftEsgS40QxStg3QB8v2XWmubFC0y+lZgx0WDCIKlRLAI/jDK7Zb5Dc3DW3i4qdyOH leavgPtj6JYI5UGCk6RHEn3cP9WQK2pp+y0oaaI3Nzz8Cg9vbnbhddleLPOTV1avp4N5KN IM0hCq5YDWOrAz+1GEMRYq417xah57AAbwXa01zkA121cSucccgNfcJV0/2G2A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715338809; 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=UgFINXGWRiR8EgXeSfQM8lOxTQyum6m7P8nY0JOMb5I=; b=DkADMrFJ74yi737x7R/wxFmZWXNMDCN2BC+pu7iLSnkuQTSu4gZuAb6PhBIHmhcnjuNtCB ZHyWeKVU3ORns6mVgN7Bc7Qg9vkYkuWI5SboyXTpA1bMdMdhVdMzR0hTFR8DiODpO+LOkn zCUGwFyk8f5OS5nL8+dJ7o75zNuKzCrSEzpdNy4giZrmPvaCKm77OxEYMhFKzNg26zz74w w+BjGeYAwtOrlwEJTCqrG7ldjlf5IAJ05IYmSqqos+UEiAtt3jA040Ar4b0GIRexgcgGTl Tz2+tyzGBzQbPSKI7z+qKZ8J2EjCs6UFIBt8ebjBudMFYxz6VgnvkEXrInYByg== 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 4VbQrn34mjzZfc; Fri, 10 May 2024 11:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44AB09jA037017; Fri, 10 May 2024 11:00:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44AB09vj037010; Fri, 10 May 2024 11:00:09 GMT (envelope-from git) Date: Fri, 10 May 2024 11:00:09 GMT Message-Id: <202405101100.44AB09vj037010@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: c6f9df706410 - main - cat: Check for lack of success rather than a specific failure. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6f9df7064106a3b016c13ea3b9a930362b53089 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=c6f9df7064106a3b016c13ea3b9a930362b53089 commit c6f9df7064106a3b016c13ea3b9a930362b53089 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-10 10:59:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-10 10:59:30 +0000 cat: Check for lack of success rather than a specific failure. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: oshogbo Differential Revision: https://reviews.freebsd.org/D45149 --- bin/cat/cat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/cat/cat.c b/bin/cat/cat.c index 5dceb1cad94b..5db2781e9912 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -198,7 +198,7 @@ main(int argc, char *argv[]) stdout_lock.l_start = 0; stdout_lock.l_type = F_WRLCK; stdout_lock.l_whence = SEEK_SET; - if (fcntl(STDOUT_FILENO, F_SETLKW, &stdout_lock) == -1) + if (fcntl(STDOUT_FILENO, F_SETLKW, &stdout_lock) != 0) err(EXIT_FAILURE, "stdout"); } @@ -266,7 +266,7 @@ scanfiles(char *argv[], int cooked __unused) #endif } else { #ifndef BOOTSTRAP_CAT - if (in_kernel_copy(fd) == -1) { + if (in_kernel_copy(fd) != 0) { if (errno == EINVAL || errno == EBADF || errno == EISDIR) raw_cat(fd); @@ -500,12 +500,12 @@ udom_open(const char *path, int flags) switch (flags & O_ACCMODE) { case O_RDONLY: cap_rights_clear(&rights, CAP_WRITE); - if (shutdown(fd, SHUT_WR) == -1) + if (shutdown(fd, SHUT_WR) != 0) warn(NULL); break; case O_WRONLY: cap_rights_clear(&rights, CAP_READ); - if (shutdown(fd, SHUT_RD) == -1) + if (shutdown(fd, SHUT_RD) != 0) warn(NULL); break; default: @@ -513,7 +513,7 @@ udom_open(const char *path, int flags) } cap_rights_clear(&rights, CAP_CONNECT, CAP_SHUTDOWN); - if (caph_rights_limit(fd, &rights) < 0) { + if (caph_rights_limit(fd, &rights) != 0) { serrno = errno; close(fd); errno = serrno;