guix-commits
[Top][All Lists]
Advanced

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

05/05: gnu-maintenance: Fix file descriptor leak.


From: Ludovic Courtès
Subject: 05/05: gnu-maintenance: Fix file descriptor leak.
Date: Sat, 17 Oct 2015 13:42:29 +0000

civodul pushed a commit to branch master
in repository guix.

commit 2134228a7d8f14f0972a3526924d8cb4540b04c2
Author: Ludovic Courtès <address@hidden>
Date:   Sat Oct 17 14:37:50 2015 +0200

    gnu-maintenance: Fix file descriptor leak.
    
    * guix/gnu-maintenance.scm (official-gnu-packages): Close the port
      returned by FETCH.
---
 guix/gnu-maintenance.scm |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm
index 920aae2..e09df4b 100644
--- a/guix/gnu-maintenance.scm
+++ b/guix/gnu-maintenance.scm
@@ -161,7 +161,10 @@ to fetch the list of GNU packages over HTTP."
                                 "doc-url"
                                 "download-url")
                           '("doc-url" "language"))))
-       (read-records (fetch %package-list-url #:text? #t))))
+       (let* ((port (fetch %package-list-url #:text? #t))
+              (lst  (read-records port)))
+         (close-port port)
+         lst)))
 
 (define (find-packages regexp)
   "Find GNU packages which satisfy REGEXP."



reply via email to

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