aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFaraz Vahedi <kfv@kfv.io>2024-10-26 15:28:07 +0000
committerMariusz Zaborski <oshogbo@FreeBSD.org>2026-03-01 17:03:12 +0000
commitdde5113f470af34bf917ca2690d89c94dc8d6db0 (patch)
tree3a192890495488f0a0c7fa28397d1eea655b6f93
parent452ee04d62e22fe923a0b616076715dad0166c98 (diff)
from(1): Replace magic exit codes with standard macros
Signed-off-by: Faraz Vahedi <kfv@kfv.io> With minor changes from committer. Reviewed by: imp, oshogbo, markj (previous version) Pull Request: https://github.com/freebsd/freebsd-src/pull/1491
-rw-r--r--usr.bin/from/from.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c
index 031803ebae16..fb194dcc72d0 100644
--- a/usr.bin/from/from.c
+++ b/usr.bin/from/from.c
@@ -30,6 +30,7 @@
*/
#include <sys/types.h>
+
#include <ctype.h>
#include <err.h>
#include <pwd.h>
@@ -99,7 +100,7 @@ main(int argc, char **argv)
mbox = stdin;
}
else if ((mbox = fopen(file, "r")) == NULL) {
- errx(1, "can't read %s", file);
+ errx(EXIT_FAILURE, "can't read %s", file);
}
for (newline = 1; fgets(buf, sizeof(buf), mbox);) {
if (*buf == '\n') {
@@ -119,14 +120,14 @@ main(int argc, char **argv)
printf("There %s %d message%s in your incoming mailbox.\n",
count == 1 ? "is" : "are", count, count == 1 ? "" : "s");
fclose(mbox);
- exit(0);
+ exit(EXIT_SUCCESS);
}
static void
usage(void)
{
fprintf(stderr, "usage: from [-c] [-f file] [-s sender] [user]\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
static int