maint: avoid "magic number exit".

* cfg.mk (local-checks-to-skip): No longer skip it.
	* bootstrap.conf (gnulib_modules): Add sysexits.
	* doc/bison.texinfo, etc/bench.pl.in, src/parse-gram.y,
	* src/system.h, tests/calc.at, tests/named-refs.at: Use assert
	where appropriate instead of "if (...) exit".
	Use symbolic exit status elsewhere.
This commit is contained in:
Akim Demaille
2012-02-18 19:19:26 +01:00
parent eff97eb54a
commit d0f2b7f856
10 changed files with 18 additions and 11 deletions

View File

@@ -9969,7 +9969,7 @@ calcxx_driver::scan_begin ()
else if (!(yyin = fopen (file.c_str (), "r")))
@{
error (std::string ("cannot open ") + file + ": " + strerror(errno));
exit (1);
exit (EXIT_FAILURE);
@}
@}
@@ -10703,11 +10703,17 @@ yyparse (char const *file)
{
yyin = fopen (file, "r");
if (!yyin)
exit (2);
{
perror ("fopen");
exit (EXIT_FAILURE);
}
/* One token only. */
yylex ();
if (fclose (yyin) != 0)
exit (3);
{
perror ("fclose");
exit (EXIT_FAILURE);
}
return 0;
}