From: Matt Birkholz Date: Wed, 29 Feb 2012 19:00:02 +0000 (-0700) Subject: Exit with non-zero status when Aborting!: out of memory... X-Git-Tag: release-9.2.0~278^2~5 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=93d3d5ca58bc32f30f1234f22b1803f01771acb3;p=mit-scheme.git Exit with non-zero status when Aborting!: out of memory... ...when run with --batch-mode. This correctly signals to make(1) that there was an error. I used nearest-cmdl/batch-mode? though I wonder what a "batch level" is. Such a thing should probably cmdl-interrupt/abort-previous rather than %exit, but this short-circuits the whole gc-clean recovery effort. I find similar yuck (a call to %exit) in ttyio.scm's operation/read-char. --- diff --git a/src/runtime/gc.scm b/src/runtime/gc.scm index fba1c9d7b..388ab88a9 100644 --- a/src/runtime/gc.scm +++ b/src/runtime/gc.scm @@ -159,9 +159,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)))))))) ((ucode-primitive request-interrupts! 1) interrupt-bit/after-gc) (hook/gc-finish start-value space-remaining))