git: 6f34788b4e24 - stable/14 - colrm(1): Replace magic exit codes with standard macros
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 29 Jan 2025 12:36:01 UTC
The branch stable/14 has been updated by oshogbo:
URL: https://cgit.FreeBSD.org/src/commit/?id=6f34788b4e24ecbd6026e2dd9fa213290f31f8d5
commit 6f34788b4e24ecbd6026e2dd9fa213290f31f8d5
Author: Faraz Vahedi <kfv@kfv.io>
AuthorDate: 2024-10-27 08:59:39 +0000
Commit: Mariusz Zaborski <oshogbo@FreeBSD.org>
CommitDate: 2025-01-29 09:51:34 +0000
colrm(1): Replace magic exit codes with standard macros
Signed-off-by: Faraz Vahedi <kfv@kfv.io>
Reviewed by: markj, oshogbo
MFC after: 1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1496
(cherry picked from commit fc26f24b3ef276b2a9f73c9778aecff7377b1aeb)
---
usr.bin/colrm/colrm.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/usr.bin/colrm/colrm.c b/usr.bin/colrm/colrm.c
index 6886a6644bf5..b199e052a3a5 100644
--- a/usr.bin/colrm/colrm.c
+++ b/usr.bin/colrm/colrm.c
@@ -87,12 +87,12 @@ main(int argc, char *argv[])
case 2:
stop = strtol(argv[1], &p, 10);
if (stop <= 0 || *p)
- errx(1, "illegal column -- %s", argv[1]);
+ errx(EXIT_FAILURE, "illegal column -- %s", argv[1]);
/* FALLTHROUGH */
case 1:
start = strtol(argv[0], &p, 10);
if (start <= 0 || *p)
- errx(1, "illegal column -- %s", argv[0]);
+ errx(EXIT_FAILURE, "illegal column -- %s", argv[0]);
break;
case 0:
break;
@@ -101,7 +101,7 @@ main(int argc, char *argv[])
}
if (stop && start > stop)
- errx(1, "illegal start and stop columns");
+ errx(EXIT_FAILURE, "illegal start and stop columns");
for (column = 0;;) {
switch (ch = getwchar()) {
@@ -134,15 +134,14 @@ void
check(FILE *stream)
{
if (feof(stream))
- exit(0);
+ exit(EXIT_SUCCESS);
if (ferror(stream))
- err(1, "%s", stream == stdin ? "stdin" : "stdout");
+ err(EXIT_FAILURE, "%s", stream == stdin ? "stdin" : "stdout");
}
void
usage(void)
{
(void)fprintf(stderr, "usage: colrm [start [stop]]\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
-