From 93d3d5ca58bc32f30f1234f22b1803f01771acb3 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Wed, 29 Feb 2012 12:00:02 -0700 Subject: [PATCH] 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. --- src/runtime/gc.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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)) -- 2.25.1