Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Nov 2024 14:26:56 GMT
From:      Mariusz Zaborski <oshogbo@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4dd6597a56f8 - main - perror(1): Replace magic exit codes with standard macros
Message-ID:  <202411271426.4AREQuZv033298@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by oshogbo:

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

commit 4dd6597a56f8c7ff03d4f451b612a9e45442c549
Author:     Faraz Vahedi <kfv@kfv.io>
AuthorDate: 2024-10-26 18:21:20 +0000
Commit:     Mariusz Zaborski <oshogbo@FreeBSD.org>
CommitDate: 2024-11-27 14:26:51 +0000

    perror(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/1492
---
 usr.bin/perror/perror.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/usr.bin/perror/perror.c b/usr.bin/perror/perror.c
index 2ef65adf56e2..e2453edc4577 100644
--- a/usr.bin/perror/perror.c
+++ b/usr.bin/perror/perror.c
@@ -53,20 +53,20 @@ main(int argc, char **argv)
 	errnum = strtol(argv[1], &cp, 0);
 
 	if (errno != 0)
-		err(1, NULL);
+		err(EXIT_FAILURE, NULL);
 
 	if ((errstr = strerror(errnum)) == NULL) 
-		err(1, NULL);
+		err(EXIT_FAILURE, NULL);
 
 	printf("%s\n", errstr);
 
-	exit(0);
+	exit(EXIT_SUCCESS);
 }
 
 static void 
 usage(void)
 {
 	fprintf(stderr, "usage: perror number\n");
-	exit(1);
+	exit(EXIT_FAILURE);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202411271426.4AREQuZv033298>