diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2023-01-29 22:13:53 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2023-01-30 22:24:27 +0100 |
| commit | 52eb3db19cb9e5c294c86a8552a4baaa5b473672 (patch) | |
| tree | ba94f91ca1d18cb07917ed3a45f43f03c1ac3a85 /gnu/build | |
| parent | 17448c8afa507bf26509cbd0a35836f910d0bf3b (diff) | |
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.
Diffstat (limited to 'gnu/build')
| -rw-r--r-- | gnu/build/linux-container.scm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gnu/build/linux-container.scm b/gnu/build/linux-container.scm index 72e3a454227..d11c49c0d80 100644 --- a/gnu/build/linux-container.scm +++ b/gnu/build/linux-container.scm | |||
| @@ -404,7 +404,7 @@ load path must be adjusted as needed." | |||
| 404 | 404 | ||
| 405 | (define (container-excursion pid thunk) | 405 | (define (container-excursion pid thunk) |
| 406 | "Run THUNK as a child process within the namespaces of process PID and | 406 | "Run THUNK as a child process within the namespaces of process PID and |
| 407 | return the exit status." | 407 | return the exit status, an integer as returned by 'waitpid'." |
| 408 | (define (namespace-file pid namespace) | 408 | (define (namespace-file pid namespace) |
| 409 | (string-append "/proc/" (number->string pid) "/ns/" namespace)) | 409 | (string-append "/proc/" (number->string pid) "/ns/" namespace)) |
| 410 | 410 | ||
| @@ -436,7 +436,7 @@ return the exit status." | |||
| 436 | (pid | 436 | (pid |
| 437 | (match (waitpid pid) | 437 | (match (waitpid pid) |
| 438 | ((_ . status) | 438 | ((_ . status) |
| 439 | (status:exit-val status)))))) | 439 | status))))) |
| 440 | 440 | ||
| 441 | (define (container-excursion* pid thunk) | 441 | (define (container-excursion* pid thunk) |
| 442 | "Like 'container-excursion', but return the return value of THUNK." | 442 | "Like 'container-excursion', but return the return value of THUNK." |
