aboutsummaryrefslogtreecommitdiff
path: root/gnu/build/linux-container.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2018-01-19 23:59:20 -0500
committerMark H Weaver <mhw@netris.org>2018-01-19 23:59:20 -0500
commite074a655dd6497daafbd62737e3b63f3d5aa7985 (patch)
tree2b198ba5c664cdd58e155f3c0113d1cebde0fc91 /gnu/build/linux-container.scm
parent6d7b26a39faf42c37f15dc64a30a77e5e194ea23 (diff)
parentccb5cac17be98aaa9c3225605d6170c675d8e8e6 (diff)
downloadgnu-guix-e074a655dd6497daafbd62737e3b63f3d5aa7985.tar
gnu-guix-e074a655dd6497daafbd62737e3b63f3d5aa7985.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/build/linux-container.scm')
-rw-r--r--gnu/build/linux-container.scm14
1 files changed, 10 insertions, 4 deletions
diff --git a/gnu/build/linux-container.scm b/gnu/build/linux-container.scm
index 70e789403f..65e1325577 100644
--- a/gnu/build/linux-container.scm
+++ b/gnu/build/linux-container.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 David Thompson <davet@gnu.org>
-;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -61,9 +61,14 @@ exists."
(const #t)
(lambda ()
(thunk)
- (primitive-exit 0))
+
+ ;; XXX: Somehow we sometimes get EBADF from write(2) or close(2) upon
+ ;; exit (coming from fd finalizers) when used by the Shepherd. To work
+ ;; around that, exit forcefully so fd finalizers don't have a chance to
+ ;; run and fail.
+ (primitive-_exit 0))
(lambda ()
- (primitive-exit 1))))
+ (primitive-_exit 1))))
(define (purify-environment)
"Unset all environment variables."
@@ -335,7 +340,8 @@ return the exit status."
(match (container-excursion pid
(lambda ()
(close-port in)
- (write (thunk) out)))
+ (write (thunk) out)
+ (close-port out)))
(0
(close-port out)
(let ((result (read in)))