From 26e1ca45bac046a1f14146e93cb900e211447972 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Wed, 14 Nov 2001 14:14:48 +0000 Subject: [PATCH] * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper definition. * src/main.c (main): Use them. Suggested by Hans Aberg. --- ChangeLog | 7 +++++++ src/main.c | 2 +- src/system.h | 12 ++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a638aafe..4484c6ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-11-14 Akim Demaille + + * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper + definition. + * src/main.c (main): Use them. + Suggested by Hans Aberg. + 2001-11-12 Akim Demaille Version 1.30b. diff --git a/src/main.c b/src/main.c index f6231386..62436a80 100644 --- a/src/main.c +++ b/src/main.c @@ -117,7 +117,7 @@ main (int argc, char *argv[]) output_files (); - exit (complain_message_count ? 1 : 0); + return complain_message_count ? EXIT_FAILURE : EXIT_SUCCESS; } /* Abort for an internal error denoted by string S. */ diff --git a/src/system.h b/src/system.h index a0b46eee..bfd24463 100644 --- a/src/system.h +++ b/src/system.h @@ -40,6 +40,18 @@ # include #endif +/* The following test is to work around the gross typo in + systems like Sony NEWS-OS Release 4.0C, whereby EXIT_FAILURE + is defined to 0, not 1. */ +#if !EXIT_FAILURE +# undef EXIT_FAILURE +# define EXIT_FAILURE 1 +#endif + +#ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +#endif + #if HAVE_UNISTD_H # include #endif -- 2.50.0