From 1708ed6e9d778795558ea4a2fd949270abd79797 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 18 Feb 2020 18:21:55 +0100 Subject: 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(-) (limited to 'gnu/build') 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 +;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès ;;; Copyright © 2018 Chris Marusich ;;; ;;; This file is part of GNU Guix. @@ -204,6 +204,7 @@ (define* (wait-for-tcp-port port marionette (catch 'system-error (lambda () (connect sock AF_INET INADDR_LOOPBACK ,port) + (close-port sock) 'success) (lambda args (if (< i ,timeout) @@ -227,6 +228,7 @@ (define* (wait-for-unix-socket file-name marionette (catch 'system-error (lambda () (connect sock AF_UNIX ,file-name) + (close-port sock) 'success) (lambda args (if (< i ,timeout) -- cgit v1.2.3