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
(cherry picked from commit 4dd6597a56)
This commit is contained in:
parent
8cf0915c19
commit
a6d0bc7065
1 changed files with 4 additions and 4 deletions
|
|
@ -61,20 +61,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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue