bug-guile
[Top][All Lists]
Advanced

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

file descriptor leakage in ftw.scm


From: Paul Jarc
Subject: file descriptor leakage in ftw.scm
Date: Wed, 08 Oct 2003 15:57:56 -0400
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

(OOC, would a patch like this be appropriate for 1.6?  What's the
policy there?)

ISTR someone suggested triggering the garbage collector after so many
open()s; that might make this patch unnecessary - if it included
opendir(), that is.  Anyway:

Index: guile-core/ice-9/ftw.scm
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/ice-9/ftw.scm,v
retrieving revision 1.2
diff -u -r1.2 ftw.scm
--- guile-core/ice-9/ftw.scm    5 Apr 2003 19:04:27 -0000       1.2
+++ guile-core/ice-9/ftw.scm    8 Oct 2003 19:51:29 -0000
@@ -197,7 +197,9 @@
     (let loop ((new (readdir dir-stream))
                (acc '()))
       (if (eof-object? new)
-          acc
+          (begin
+            (closedir dir-stream)
+            acc)
           (loop (readdir dir-stream)
                 (if (or (string=? "."  new)             ;;; ignore
                         (string=? ".." new))            ;;; ignore


paul




reply via email to

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