git: b6fb1131e64f - stable/13 - cat: Check for lack of success rather than a specific failure.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 14 May 2024 06:59:25 UTC
The branch stable/13 has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=b6fb1131e64f47854c08ab8ee733aed1f6f81180
commit b6fb1131e64f47854c08ab8ee733aed1f6f81180
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2024-05-10 10:59:18 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2024-05-14 06:59:12 +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 | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/bin/cat/cat.c b/bin/cat/cat.c
index dc6e6417dc49..48294be5c5b5 100644
--- a/bin/cat/cat.c
+++ b/bin/cat/cat.c
@@ -138,7 +138,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
@@ -211,7 +211,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");
}
@@ -219,7 +219,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)
@@ -456,7 +456,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);
@@ -494,7 +494,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;