]> git.saurik.com Git - bison.git/commitdiff
* src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
authorAkim Demaille <akim@epita.fr>
Wed, 14 Nov 2001 14:14:48 +0000 (14:14 +0000)
committerAkim Demaille <akim@epita.fr>
Wed, 14 Nov 2001 14:14:48 +0000 (14:14 +0000)
definition.
* src/main.c (main): Use them.
Suggested by Hans Aberg.

ChangeLog
src/main.c
src/system.h

index a638aafe6ae06002dad3d26fd0bd9f4394bece78..4484c6ecb29f64440c09742f69ed8721956c972b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-11-14  Akim Demaille  <akim@epita.fr>
+
+       * 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  <akim@epita.fr>
 
        Version 1.30b.
index f6231386fc531533638248eb79f5eaa0ece82f8f..62436a806914b14e38ec28d48d378e5cb1e0dfa9 100644 (file)
@@ -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;
 }
 \f
 /* Abort for an internal error denoted by string S.  */
index a0b46eee3460882003d18a77b13c5c8f23b6d46d..bfd244637a0b8fe1efb9508df6f9ea07eaf4a16e 100644 (file)
 # include <stdlib.h>
 #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 <unistd.h>
 #endif