mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
(main): Use exit to exit with failure.
Use EXIT_FAILURE and EXIT_SUCCESS rather than 1 and 0.
This commit is contained in:
15
src/main.c
15
src/main.c
@@ -73,8 +73,8 @@ main (int argc, char *argv[])
|
||||
reader ();
|
||||
timevar_pop (TV_READER);
|
||||
|
||||
if (complain_message_count)
|
||||
exit (1);
|
||||
if (complaint_issued)
|
||||
exit (EXIT_FAILURE);
|
||||
|
||||
/* Find useless nonterminals and productions and reduce the grammar. */
|
||||
timevar_push (TV_REDUCE);
|
||||
@@ -137,8 +137,8 @@ main (int argc, char *argv[])
|
||||
|
||||
/* Stop if there were errors, to avoid trashing previous output
|
||||
files. */
|
||||
if (complain_message_count)
|
||||
exit (1);
|
||||
if (complaint_issued)
|
||||
exit (EXIT_FAILURE);
|
||||
|
||||
/* Lookaheads are no longer needed. */
|
||||
timevar_push (TV_FREE);
|
||||
@@ -177,5 +177,10 @@ main (int argc, char *argv[])
|
||||
timevar_stop (TV_TOTAL);
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user