From: Paul Eggert Date: Wed, 23 Oct 2002 07:00:19 +0000 (+0000) Subject: (main): Use return to exit, undoing yesterday's change. X-Git-Tag: BISON-1_875~395 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/e95aed631d9a90838db0c6d3760750aba2d5198b?ds=inline (main): Use return to exit, undoing yesterday's change. The last OS that we could find where this wouldn't work is SunOS 3.5, and that's too old to worry about now. --- diff --git a/src/main.c b/src/main.c index dc28693f..7ee6c673 100644 --- a/src/main.c +++ b/src/main.c @@ -74,7 +74,7 @@ main (int argc, char *argv[]) timevar_pop (TV_READER); if (complaint_issued) - exit (EXIT_FAILURE); + return EXIT_FAILURE; /* Find useless nonterminals and productions and reduce the grammar. */ timevar_push (TV_REDUCE); @@ -138,7 +138,7 @@ main (int argc, char *argv[]) /* Stop if there were errors, to avoid trashing previous output files. */ if (complaint_issued) - exit (EXIT_FAILURE); + return EXIT_FAILURE; /* Lookaheads are no longer needed. */ timevar_push (TV_FREE); @@ -177,10 +177,5 @@ main (int argc, char *argv[]) timevar_stop (TV_TOTAL); timevar_print (stderr); - /* 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; + return complaint_issued ? EXIT_FAILURE : EXIT_SUCCESS; }