summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-01-22 19:49:47 +0000
committerJim Meyering <jim@meyering.net>2004-01-22 19:49:47 +0000
commitbdb46518eecbe0ba40f4a548463c73dee76526ed (patch)
treecb03a0a1f4d0c75733e0fc969172204316f6c55e /src
parent01e1d061bcadd6d16b9df91147620ca3204129ab (diff)
downloadcoreutils-bdb46518eecbe0ba40f4a548463c73dee76526ed.tar.xz
(usage): Use EXIT_SUCCESS, not 0, for clarity.
(usage): Don't bother normalizing exit status since the arg is already the correct exit status now. (FATAL_ERROR, main): Exit with status EXIT_FAILURE, not 2, on errors.
Diffstat (limited to 'src')
-rw-r--r--src/pr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pr.c b/src/pr.c
index 04aa1c887..4492698c7 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -1,5 +1,5 @@
/* pr -- convert text files for printing.
- Copyright (C) 88, 91, 1995-2003 Free Software Foundation, Inc.
+ Copyright (C) 88, 91, 1995-2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -801,7 +801,7 @@ first_last_page (char *pages)
if (*pages == ':')
{
error (0, 0, _("`--pages' invalid range of page numbers: `%s'"), pages);
- usage (2);
+ usage (EXIT_FAILURE);
}
str1 = strchr (pages, ':');
@@ -1068,7 +1068,7 @@ main (int argc, char **argv)
case_GETOPT_HELP_CHAR;
case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
default:
- usage (2);
+ usage (EXIT_FAILURE);
break;
}
}
@@ -1186,7 +1186,7 @@ getoptarg (char *arg, char switch_char, char *character, int *number)
error (0, 0,
_("`-%c' extra characters or invalid number in the argument: `%s'"),
switch_char, arg);
- usage (2);
+ usage (EXIT_FAILURE);
}
*number = (int) tmp_long;
}
@@ -2744,7 +2744,7 @@ cleanup (void)
void
usage (int status)
{
- if (status != 0)
+ if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
program_name);
else
@@ -2859,5 +2859,5 @@ FILE is -, read standard input.\n\
"), stdout);
printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
}
- exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
+ exit (status);
}