summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/scripts/environment.scm11
-rw-r--r--tests/guix-environment-container.sh7
2 files changed, 16 insertions, 2 deletions
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 97410f4e098..fae261733ec 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -317,8 +317,15 @@ requisite store items i.e. the union closure of all the inputs."
317 (map input->requisites inputs)))) 317 (map input->requisites inputs))))
318 (return (delete-duplicates (concatenate reqs))))) 318 (return (delete-duplicates (concatenate reqs)))))
319 319
320(define exit/status (compose exit status:exit-val)) 320(define (status->exit-code status)
321(define primitive-exit/status (compose primitive-exit status:exit-val)) 321 "Compute the exit code made from STATUS, a value as returned by 'waitpid',
322and suitable for 'exit'."
323 ;; See <bits/waitstatus.h>.
324 (or (status:exit-val status)
325 (logior #x80 (status:term-sig status))))
326
327(define exit/status (compose exit status->exit-code))
328(define primitive-exit/status (compose primitive-exit status->exit-code))
322 329
323(define (launch-environment command inputs paths pure?) 330(define (launch-environment command inputs paths pure?)
324 "Run COMMAND in a new environment containing INPUTS, using the native search 331 "Run COMMAND in a new environment containing INPUTS, using the native search
diff --git a/tests/guix-environment-container.sh b/tests/guix-environment-container.sh
index 5670d011179..703ab31d278 100644
--- a/tests/guix-environment-container.sh
+++ b/tests/guix-environment-container.sh
@@ -81,3 +81,10 @@ grep $(guix build guile-bootstrap) $tmpdir/mounts
81grep -e "$NIX_STORE_DIR/.*-bash" $tmpdir/mounts # bootstrap bash 81grep -e "$NIX_STORE_DIR/.*-bash" $tmpdir/mounts # bootstrap bash
82 82
83rm $tmpdir/mounts 83rm $tmpdir/mounts
84
85if guix environment --bootstrap --container \
86 --ad-hoc bootstrap-binaries -- kill -SEGV 2
87then false;
88else
89 test $? -gt 127
90fi