Exit with non-zero status when Aborting!: out of memory...
authorMatt Birkholz <matt@birchwood-abbey.net>
Fri, 3 Feb 2017 23:56:48 +0000 (16:56 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Fri, 3 Feb 2017 23:56:48 +0000 (16:56 -0700)
...in --batch-mode.  This is basically 93d3d5c, which was mistakenly
undone by 85c1fb4 because it assumed the abort resulted in an error
that would stop the REPL.  Signaling an error after the restart and
cleanup is... tricky... so just %exit.

src/runtime/gc.scm

index 0d7c072abd59700af92ade69198e9363352aac45..f3bba52e6cb3557eace238870439c859fe8a6fcc 100644 (file)
@@ -134,9 +134,13 @@ USA.
        (cmdl-message/strings "Aborting!: out of memory")
        ;; Clean up whatever possible to avoid a reoccurrence.
        (cmdl-message/active
-        (lambda (port)
-          port
-          (with-gc-notification! #t gc-clean)))))))
+        (if (nearest-cmdl/batch-mode?)
+            (lambda (port)
+              (newline port)
+              (%exit 1))
+            (lambda (port)
+              port
+              (with-gc-notification! #t gc-clean))))))))
 
 (define gc-boot-loading?)