]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(usage): Use EXIT_SUCCESS, not 0, for clarity.
authorJim Meyering <jim@meyering.net>
Wed, 21 Jan 2004 23:30:09 +0000 (23:30 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 21 Jan 2004 23:30:09 +0000 (23:30 +0000)
(usage): Don't bother normalizing exit status
since the arg is already the correct exit status now.
(main): Exit with status 1, not 2, on errors detected by nl proper.

src/nl.c

index 7fa88120c13faa845c268c11932fe78ece879e1d..cc4865ef48f1fbce58d3314e6aaee94720377334 100644 (file)
--- a/src/nl.c
+++ b/src/nl.c
@@ -1,5 +1,5 @@
 /* nl -- number lines of files
-   Copyright (C) 89, 92, 1995-2003 Free Software Foundation, Inc.
+   Copyright (C) 89, 92, 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
@@ -168,7 +168,7 @@ static struct option const longopts[] =
 void
 usage (int status)
 {
-  if (status != 0)
+  if (status != EXIT_SUCCESS)
     fprintf (stderr, _("Try `%s --help' for more information.\n"),
             program_name);
   else
@@ -226,7 +226,7 @@ FORMAT is one of:\n\
 "), stdout);
       printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
     }
-  exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
+  exit (status);
 }
 
 /* Build the printf format string, based on `lineno_format'. */
@@ -606,7 +606,7 @@ main (int argc, char **argv)
     }
 
   if (fail)
-    usage (2);
+    usage (EXIT_FAILURE);
 
   /* Initialize the section delimiters.  */
   len = strlen (section_del);