summary refs log tree commit diff
path: root/gnu/build/marionette.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-02-18 18:21:55 +0100
committerLudovic Courtès <ludo@gnu.org>2020-02-22 00:45:42 +0100
commit1708ed6e9d778795558ea4a2fd949270abd79797 (patch)
treeafc76aff6a063dcd5dd576b190b977ac1eabc5f6 /gnu/build/marionette.scm
parent3c4c60fa79aac43aa31c1d27732b067ad3842528 (diff)
downloadguix-1708ed6e9d778795558ea4a2fd949270abd79797.tar.gz
marionette: 'wait-for' procedures no longer leak a port.
* gnu/build/marionette.scm (wait-for-tcp-port): Close SOCK upon
success.
(wait-for-unix-socket): Likewise.
Diffstat (limited to 'gnu/build/marionette.scm')
-rw-r--r--gnu/build/marionette.scm4
1 files changed, 3 insertions, 1 deletions
diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm
index 1dbe385e89..a9dbce538f 100644
--- a/gnu/build/marionette.scm
+++ b/gnu/build/marionette.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -204,6 +204,7 @@ MARIONETTE.  Raise an error on failure."
                  (catch 'system-error
                    (lambda ()
                      (connect sock AF_INET INADDR_LOOPBACK ,port)
+                     (close-port sock)
                      'success)
                    (lambda args
                      (if (< i ,timeout)
@@ -227,6 +228,7 @@ accept connections in MARIONETTE.  Raise an error on failure."
                  (catch 'system-error
                    (lambda ()
                      (connect sock AF_UNIX ,file-name)
+                     (close-port sock)
                      'success)
                    (lambda args
                      (if (< i ,timeout)