(main): Use exit to exit with failure.

Use EXIT_FAILURE and EXIT_SUCCESS rather than 1 and 0.
This commit is contained in:
Paul Eggert
2002-10-22 05:07:12 +00:00
parent 0df27e8b2d
commit 5ca3209b44

View File

@@ -73,8 +73,8 @@ main (int argc, char *argv[])
reader (); reader ();
timevar_pop (TV_READER); timevar_pop (TV_READER);
if (complain_message_count) if (complaint_issued)
exit (1); exit (EXIT_FAILURE);
/* Find useless nonterminals and productions and reduce the grammar. */ /* Find useless nonterminals and productions and reduce the grammar. */
timevar_push (TV_REDUCE); timevar_push (TV_REDUCE);
@@ -137,8 +137,8 @@ main (int argc, char *argv[])
/* Stop if there were errors, to avoid trashing previous output /* Stop if there were errors, to avoid trashing previous output
files. */ files. */
if (complain_message_count) if (complaint_issued)
exit (1); exit (EXIT_FAILURE);
/* Lookaheads are no longer needed. */ /* Lookaheads are no longer needed. */
timevar_push (TV_FREE); timevar_push (TV_FREE);
@@ -177,5 +177,10 @@ main (int argc, char *argv[])
timevar_stop (TV_TOTAL); timevar_stop (TV_TOTAL);
timevar_print (stderr); timevar_print (stderr);
return complain_message_count ? EXIT_FAILURE : EXIT_SUCCESS; /* Some ancient SunOS versions exit (0) if main returns, so use
`exit' to exit with nonzero status. */
if (complaint_issued)
exit (EXIT_FAILURE);
return EXIT_SUCCESS;
} }