Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 Mar 2026 17:06:27 +0000
From:      Mariusz Zaborski <oshogbo@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Cc:        Faraz Vahedi <kfv@kfv.io>
Subject:   git: dde5113f470a - main - from(1): Replace magic exit codes with standard macros
Message-ID:  <69a47213.3dbbd.32c6f3f7@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by oshogbo:

URL: https://cgit.FreeBSD.org/src/commit/?id=dde5113f470af34bf917ca2690d89c94dc8d6db0

commit dde5113f470af34bf917ca2690d89c94dc8d6db0
Author:     Faraz Vahedi <kfv@kfv.io>
AuthorDate: 2024-10-26 15:28:07 +0000
Commit:     Mariusz Zaborski <oshogbo@FreeBSD.org>
CommitDate: 2026-03-01 17:03:12 +0000

    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
---
 usr.bin/from/from.c | 7 ++++---
 1 file 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


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69a47213.3dbbd.32c6f3f7>