guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/12: marionette: 'wait-for' procedures no longer leak a port.


From: guix-commits
Subject: 01/12: marionette: 'wait-for' procedures no longer leak a port.
Date: Fri, 21 Feb 2020 17:08:36 -0500 (EST)

civodul pushed a commit to branch wip-installer-test
in repository guix.

commit bf4484f550162080e77e17a2ee541f01861963df
Author: Ludovic Courtès <address@hidden>
AuthorDate: Tue Feb 18 18:21:55 2020 +0100

    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.
---
 gnu/build/marionette.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/build/marionette.scm b/gnu/build/marionette.scm
index 1dbe385..a9dbce5 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 <address@hidden>
+;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2018 Chris Marusich <address@hidden>
 ;;;
 ;;; 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]