From nobody Tue May 14 06:59:07 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 4VdnJq48RLz5KYWJ; Tue, 14 May 2024 06:59:07 +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 4VdnJq2bkpz4pf4; Tue, 14 May 2024 06:59:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715669947; 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=oW5/RTarpmd10q3VAfcMoRK8mW1UCO9PQjeM2hYss3s=; b=K1cANQ07LBtwuZgPDtvGF3Sj100y4T6MtkAw9UylOtn+xS+H3i5nUutMYkcJ0rQZ+2EnNI rHaEoZvbBZTY3GbXdgFHHeWHi5DI8a50AQmLZ/pQ9cZWavUTs+ObCBaXy2vvcZhiLXv0J9 UoiX0MdDwPu1ee2btNr+x+ueEfIQckQEA0l4Js4+VjB2hrha+N4JW5Dy993Na1+Vo6i1nX RqRipHwLRumMKWGFvaNcqRq3K3l4l7VWYb6PFZzxGwB9ppsqk7nElPNJ4riHkmZAzV6BRP VZ8AMQLkLpxu+WVT3QE+9GKoDPSikwJAVab+45Sp1Nv8MPwGyzZvxWjsvo1DQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715669947; a=rsa-sha256; cv=none; b=TGmjj5B7hrj4R4FfxLOJecwtKyclHRfsDKBJ9gz4HYz8Di4pCxgTbKMUGtSIN37h5HgU1M bVmqf415gdCbww+C9UyXlhoCHdEukB76R+GXvcJyJBfYdi7+kcD+AJKR4osVYg8XffQwli KXwa1CFCMoSwMxgO4dbRINuqbIh7o137A6DTv12CkzG7ATV3DhDqf78y7CQlNH71a5fEUI yhgRv36Lz7Eaq5aOfBw1oE8opiZXNh8Wc+r0bf2rPprjDXKk/NrarAcl3pKGfTwa84YSp7 BOlW5NDGpanhx6zEUozftg/7mPWu1fWNhLJRBEp4fMzZQZWSJvm9DfzNV6aiJQ== 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=1715669947; 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=oW5/RTarpmd10q3VAfcMoRK8mW1UCO9PQjeM2hYss3s=; b=SwCWWnCpe1f6j+3WxXV2Zc1CoEIDLNB49AsILjJvem3EsDK4BuNfvdM3LDFTmOYMH6bh5K tYHO0AwlGXAPcmrfv5GU8IUb8meT96DxsVIBLD8RpZWokuSar6fScanPuFn1ZvAbN26JP+ lwzdwquQL1817Cz3QFZNsnbUlWpq1TGhXgrwPiOSp3prnarSODvTZj2LlZRq0VX9QCHlb4 MX6WQS/Sl/qLe1Z4kfsKCWmeuNJfx1DFloywaYOo+Ff2zalxpCdNc8niBnGK8A5xOynXx7 sn4cS5aFw+ij+BT+cLzW6bLhUZihoABZoa9HwEcyzGS0DnSTEWPl2tBhMXTpDQ== 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 4VdnJq1vTnzM5J; Tue, 14 May 2024 06:59:07 +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 44E6x7OO004759; Tue, 14 May 2024 06:59:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44E6x7a9004757; Tue, 14 May 2024 06:59:07 GMT (envelope-from git) Date: Tue, 14 May 2024 06:59:07 GMT Message-Id: <202405140659.44E6x7a9004757@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: afd1256257f5 - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: afd1256257f524f764627eaabb4d887ddecc6557 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=afd1256257f524f764627eaabb4d887ddecc6557 commit afd1256257f524f764627eaabb4d887ddecc6557 Author: Dag-Erling Smørgrav AuthorDate: 2024-05-10 10:59:18 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-05-14 06:58:40 +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 (cherry picked from commit c6f9df7064106a3b016c13ea3b9a930362b53089) cat: Missed a couple. MFC after: 3 days Sponsored by: Klara, Inc. (cherry picked from commit ad4f3bdf733c1a670021f4db378338f5aaedbfd8) --- bin/cat/cat.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/cat/cat.c b/bin/cat/cat.c index 81ec5feec240..9d40a3f0fa35 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -139,7 +139,7 @@ init_casper_net(cap_channel_t *casper) familylimit = AF_LOCAL; cap_net_limit_name2addr_family(limit, &familylimit, 1); - if (cap_net_limit(limit) < 0) + if (cap_net_limit(limit) != 0) err(EXIT_FAILURE, "unable to apply limits"); } #endif @@ -212,7 +212,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"); } @@ -220,7 +220,7 @@ main(int argc, char *argv[]) caph_cache_catpages(); - if (caph_enter_casper() < 0) + if (caph_enter_casper() != 0) err(EXIT_FAILURE, "capsicum"); if (bflag || eflag || nflag || sflag || tflag || vflag) @@ -280,7 +280,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); @@ -485,7 +485,7 @@ udom_open(const char *path, int flags) errno = serrno; return (-1); } - if (caph_rights_limit(fd, &rights) < 0) { + if (caph_rights_limit(fd, &rights) != 0) { serrno = errno; close(fd); freeaddrinfo(res0); @@ -514,12 +514,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: @@ -527,7 +527,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;