From: Jim Meyering Date: Wed, 21 Jan 2004 22:52:53 +0000 (+0000) Subject: (usage): Use EXIT_SUCCESS, not 0, for clarity. X-Git-Tag: v5.1.2~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8abeccf9d479656951ff5733444d94ba9eee59e0;p=thirdparty%2Fcoreutils.git (usage): Use EXIT_SUCCESS, not 0, for clarity. (FATAL_ERROR, main): Exit with status EXIT_FAILURE, not 2, on errors. (main): Don't assume EXIT_FAILURE == 1, as POSIX doesn't require it. --- diff --git a/src/date.c b/src/date.c index aa4b6a6134..37295a1664 100644 --- a/src/date.c +++ b/src/date.c @@ -1,5 +1,5 @@ /* date - print or set the system date and time - Copyright (C) 1989-2003 Free Software Foundation, Inc. + Copyright (C) 1989-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 @@ -28,7 +28,6 @@ #include "system.h" #include "argmatch.h" #include "error.h" -#include "exitfail.h" #include "getdate.h" #include "getline.h" #include "posixtm.h" @@ -111,7 +110,7 @@ static struct option const long_options[] = void usage (int status) { - if (status != 0) + if (status != EXIT_SUCCESS) fprintf (stderr, _("Try `%s --help' for more information.\n"), program_name); else @@ -277,7 +276,7 @@ batch_convert (const char *input_filename, const char *format) } if (fclose (in_stream) == EOF) - error (2, errno, "%s", quote (input_filename)); + error (EXIT_FAILURE, errno, "%s", quote (input_filename)); if (line != NULL) free (line); @@ -310,7 +309,6 @@ main (int argc, char **argv) bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); - exit_failure = 2; atexit (close_stdout); while ((optc = getopt_long (argc, argv, short_options, long_options, NULL)) @@ -476,7 +474,7 @@ argument must be a format string beginning with `+'."), show_date (format, when); } - exit (status); + exit (status == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } /* Display the date and/or time in WHEN according to the format specified