mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 17:53:02 +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 ();
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user