diff options
author | Richard Stallman <rms@gnu.org> | 1993-11-13 08:59:22 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-11-13 08:59:22 +0000 |
commit | f7d4a1c989525862b819f4b3c13e67dfda147c3b (patch) | |
tree | cbf7e004e8678ad50a6c7d08865944e1e1bdd66c | |
parent | e31f69f1a3ee92358425f26e69651e7e40a7baff (diff) | |
download | gcc-f7d4a1c989525862b819f4b3c13e67dfda147c3b.zip gcc-f7d4a1c989525862b819f4b3c13e67dfda147c3b.tar.gz gcc-f7d4a1c989525862b819f4b3c13e67dfda147c3b.tar.bz2 |
Use FATAL_EXIT_CODE rather than hardcoded 1 for fatal error.
(main): Flush stdout and and check for errors prior to termination;
end with call to exit rather than return from main, as with gen*.c.
From-SVN: r6078
-rw-r--r-- | gcc/bi-arity.c | 6 | ||||
-rw-r--r-- | gcc/bi-opcode.c | 5 | ||||
-rw-r--r-- | gcc/bi-opname.c | 6 |
3 files changed, 14 insertions, 3 deletions
diff --git a/gcc/bi-arity.c b/gcc/bi-arity.c index 1bbbfc3..0b72897 100644 --- a/gcc/bi-arity.c +++ b/gcc/bi-arity.c @@ -54,6 +54,10 @@ main () printf ("0"); printf ("}},\n"); } + + fflush (stdout); + exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); + /* NOTREACHED */ return 0; } @@ -68,7 +72,7 @@ xmalloc (nbytes) if (!tmp) { fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes); - exit (1); + exit (FATAL_EXIT_CODE); } return tmp; diff --git a/gcc/bi-opcode.c b/gcc/bi-opcode.c index 74514d4..3320845 100644 --- a/gcc/bi-opcode.c +++ b/gcc/bi-opcode.c @@ -50,6 +50,9 @@ enum bytecode_opcode\n{"); else fprintf (stderr, "(Number of opcodes is %d)\n", i); + fflush (stdout); + exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); + /* NOTREACHED */ return 0; } @@ -64,7 +67,7 @@ xmalloc (nbytes) if (!tmp) { fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes); - exit (1); + exit (FATAL_EXIT_CODE); } return tmp; diff --git a/gcc/bi-opname.c b/gcc/bi-opname.c index 9eda2be..02dfabc 100644 --- a/gcc/bi-opname.c +++ b/gcc/bi-opname.c @@ -33,6 +33,10 @@ main() for (d = defs; d; d = d->next) for (v = d->variations; v; v = v->next) printf("\"%s%s\",\n", d->basename, v->name); + + fflush (stdout); + exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); + /* NOTREACHED */ return 0; } @@ -47,7 +51,7 @@ xmalloc (nbytes) if (!tmp) { fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes); - exit (1); + exit (FATAL_EXIT_CODE); } return tmp; |