Use FATAL_EXIT_CODE rather than hardcoded 1 for fatal error.
authorRichard Stallman <rms@gnu.org>
Sat, 13 Nov 1993 08:59:22 +0000 (08:59 +0000)
committerRichard Stallman <rms@gnu.org>
Sat, 13 Nov 1993 08:59:22 +0000 (08:59 +0000)
(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

gcc/bi-arity.c
gcc/bi-opcode.c
gcc/bi-opname.c

index 1bbbfc3bc1e9135ca5d80f6814bbfdc99112fbb6..0b728974497a51da8f6457831bd3470938a4737a 100644 (file)
@@ -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;
index 74514d4a745a414c878afbc6e44b77067577b9c9..332084553233b1c4428197294b41d043b4549258 100644 (file)
@@ -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;
index 9eda2be602a8666e8b4aae76cfee48269ba92815..02dfabcfd8bd6d2c65189d0ca0c51da78ec161eb 100644 (file)
@@ -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;