From 52eb3db19cb9e5c294c86a8552a4baaa5b473672 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 29 Jan 2023 22:13:53 +0100 Subject: container: Correctly report exit status. * gnu/build/linux-container.scm (container-excursion): Return the raw status value. * tests/containers.scm ("container-excursion, same namespaces"): Add 'status:exit-val' call. * guix/scripts/container/exec.scm (guix-container-exec): Correctly handle the different cases. --- gnu/build/linux-container.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnu/build') diff --git a/gnu/build/linux-container.scm b/gnu/build/linux-container.scm index 72e3a45422..d11c49c0d8 100644 --- a/gnu/build/linux-container.scm +++ b/gnu/build/linux-container.scm @@ -404,7 +404,7 @@ (define (relay-signal signal) (define (container-excursion pid thunk) "Run THUNK as a child process within the namespaces of process PID and -return the exit status." +return the exit status, an integer as returned by 'waitpid'." (define (namespace-file pid namespace) (string-append "/proc/" (number->string pid) "/ns/" namespace)) @@ -436,7 +436,7 @@ (define (namespace-file pid namespace) (pid (match (waitpid pid) ((_ . status) - (status:exit-val status)))))) + status))))) (define (container-excursion* pid thunk) "Like 'container-excursion', but return the return value of THUNK." -- cgit v1.2.3