aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-09-25 16:46:41 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-11-08 16:18:18 -0700
commit8b78f68a7bb3dc97e9797d17317d5f30ec982ce6 (patch)
tree0249efd1b4437a0ac91999164a474895bb518819
parent0dce5f6c3024660929d104fb5299a999a82fc224 (diff)
downloadconsfigurator-8b78f68a7bb3dc97e9797d17317d5f30ec982ce6.tar.gz
use higher-numbered codes for change status, 1 for unhandled errors
When SBCL fails to start up, such as when previously-loaded shared libraries cannot be found while trying to reinvoke a dumped image, it exits 1. We must avoid erroneously interpreting this as a successful attempt to make changes. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/connection/fork.lisp2
-rw-r--r--src/connection/sbcl.lisp2
-rw-r--r--src/image.lisp2
-rw-r--r--src/util.lisp14
4 files changed, 10 insertions, 10 deletions
diff --git a/src/connection/fork.lisp b/src/connection/fork.lisp
index f55896d..2958a04 100644
--- a/src/connection/fork.lisp
+++ b/src/connection/fork.lisp
@@ -66,7 +66,7 @@ single-threaded context for the execution of POST-FORK."))
((serious-condition
(lambda (c)
(trivial-backtrace:print-backtrace c :output *error-output*)
- (uiop:quit 3))))
+ (uiop:quit 1))))
;; Handle the finaliser thread in older SBCL, before the change in
;; 2.1.8 to call *INIT-HOOKS* before starting system threads.
#+consfigurator.connection.fork::older-sbcl
diff --git a/src/connection/sbcl.lisp b/src/connection/sbcl.lisp
index f487de3..9d488ca 100644
--- a/src/connection/sbcl.lisp
+++ b/src/connection/sbcl.lisp
@@ -62,7 +62,7 @@ recommended."))
(multiple-value-bind (program forms)
(continue-deploy*-program remaining requirements)
(multiple-value-bind (out err exit) (run :may-fail :input program *sbcl*)
- (inform t (if (< exit 3) "done." "failed.") :fresh-line nil)
+ (inform t (if (member exit '(0 22 23)) "done." "failed.") :fresh-line nil)
(when-let ((lines (lines out)))
(inform t " Output was:" :fresh-line nil)
(with-indented-inform (inform t lines)))
diff --git a/src/image.lisp b/src/image.lisp
index 09fc392..969cea0 100644
--- a/src/image.lisp
+++ b/src/image.lisp
@@ -565,7 +565,7 @@ Preprocessing must occur in the root Lisp."))
*error-output*
"~&Failed to compile and/or load:~%~A~&~%Compile and/or load output:~%~%~A"
c string)
- (uiop:quit 3)))
+ (uiop:quit 1)))
(when (>= *consfigurator-debug-level* 3)
(format t "~&~A" string))))
;; Continue the deployment. The READ indirection is to try
diff --git a/src/util.lisp b/src/util.lisp
index fd6d020..cee463f 100644
--- a/src/util.lisp
+++ b/src/util.lisp
@@ -580,23 +580,23 @@ interactive debugger."))
(lambda (c)
(trivial-backtrace:print-backtrace
c :output *error-output*)
- (uiop:quit 3)))
+ (uiop:quit 1)))
(skipped-properties (lambda (c)
(declare (ignore c))
(setq ,failures t))))
,@forms)))
(uiop:quit (cond ((eql :no-change result) 0)
- (,failures 2)
- (t 1))))))
+ (,failures 22)
+ (t 23))))))
(defmacro return-exit (exit &key on-failure)
`(values
nil
(case ,exit
- (0 :no-change)
- (1 nil)
- (2 (signal 'skipped-properties) nil)
- (t ,on-failure))))
+ (0 :no-change)
+ (22 (signal 'skipped-properties) nil)
+ (23 nil)
+ (t ,on-failure))))
(defun posix-login-environment (&optional uid logname home)
"Reset the environment after switching UID, or similar, in a :LISP connection.