summaryrefslogtreecommitdiff
path: root/guix/inferior.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-05-26 17:11:20 +0200
committerLudovic Courtès <ludo@gnu.org>2022-05-26 17:11:20 +0200
commit7097e98586df3110b80943a88c27804d65f214fa (patch)
tree2e244b9fc19acc569d6abd42306aaf013f02da0d /guix/inferior.scm
parent15870cc08d20501e3526fa892111a43ae9e3e02f (diff)
parent4577f3c6b60ea100e521c246fb169d6c05214b20 (diff)
downloadguix-patches-7097e98586df3110b80943a88c27804d65f214fa.tar
guix-patches-7097e98586df3110b80943a88c27804d65f214fa.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'guix/inferior.scm')
-rw-r--r--guix/inferior.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/guix/inferior.scm b/guix/inferior.scm
index 6949bb3687..54200b75e4 100644
--- a/guix/inferior.scm
+++ b/guix/inferior.scm
@@ -141,7 +141,11 @@ regular file port (socket).
This is equivalent to (open-pipe* OPEN_BOTH ...) except that the result is a
regular file port that can be passed to 'select' ('open-pipe*' returns a
custom binary port)."
- (match (socketpair AF_UNIX SOCK_STREAM 0)
+ ;; Make sure the sockets are close-on-exec; failing to do that, a second
+ ;; inferior (for instance) would inherit the underlying file descriptor, and
+ ;; thus (close-port PARENT) in the original process would have no effect:
+ ;; the REPL process wouldn't get EOF on standard input.
+ (match (socketpair AF_UNIX (logior SOCK_STREAM SOCK_CLOEXEC) 0)
((parent . child)
(match (primitive-fork)
(0