diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-07-05 16:29:46 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-07-10 20:45:21 -0700 |
commit | 56bc5a2c24b0fe56c72ced9a5ac85d982d592567 (patch) | |
tree | d01d1820afeadd4d50794e45007bba9d9533b373 /src/connection/fork.lisp | |
parent | ec508517bc89d3934afa9ec91f3787839b14be2d (diff) | |
download | consfigurator-56bc5a2c24b0fe56c72ced9a5ac85d982d592567.tar.gz |
signal SKIPPED-PROPERTIES & factor out interpreting exit codes
Unconditionally signalling FAILED-CHANGE does not make sense because perhaps
the type of condition C is not a subtype of SIMPLE-CONDITION. Moreover, when
we invoke the SKIP-PROPERTY restart we do not actually pass the condition.
For simplicity, and since all we need is notification that a SKIP-PROPERTY
restart was invoked, instead define and signal a special-purpose condition.
Additionally, use an exit code to pass the signal between Lisp images.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection/fork.lisp')
-rw-r--r-- | src/connection/fork.lisp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/connection/fork.lisp b/src/connection/fork.lisp index 169552d..1eb6568 100644 --- a/src/connection/fork.lisp +++ b/src/connection/fork.lisp @@ -66,7 +66,7 @@ for example, such that we don't see it." (-1 (error "fork(2) failed")) (0 - (with-backtrace-and-exit-code-two + (with-backtrace-and-exit-code ;; Capture child stdout in case *STANDARD-OUTPUT* has been rebound ;; to somewhere else in the parent, e.g. by APPLY-AND-PRINT. The ;; parent can then send the contents of the file named by OUTPUT to @@ -89,10 +89,7 @@ for example, such that we don't see it." ;; (establish-connection :local)) here, but we need to kill off ;; the child afterwards, rather than returning to the child's ;; REPL or whatever else. - (uiop:quit - (if (eql :no-change (continue-deploy* connection remaining)) - 0 - 1))))) + (continue-deploy* connection remaining)))) (t (multiple-value-bind (pid status) (waitpid child 0) (declare (ignore pid)) @@ -104,7 +101,8 @@ for example, such that we don't see it." "Fork connection child did not exit normally, status #x~(~4,'0X~)" status)) (let ((exit-status (wexitstatus status))) - (unless (< exit-status 2) - (failed-change - "Fork connection child failed, exit code ~D" exit-status)) - (values nil (and (zerop status) :no-change)))))))))) + (return-exit + exit-status + :on-failure + (failed-change "Fork connection child failed, exit code ~D" + exit-status)))))))))) |