The branch main has been updated by oshogbo:

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

commit dde5113f470af34bf917ca2690d89c94dc8d6db0
Author:     Faraz Vahedi <[email protected]>
AuthorDate: 2024-10-26 15:28:07 +0000
Commit:     Mariusz Zaborski <[email protected]>
CommitDate: 2026-03-01 17:03:12 +0000

    from(1): Replace magic exit codes with standard macros
    
    Signed-off-by: Faraz Vahedi <[email protected]>
    
    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

Reply via email to