Fix: file descriptor leak in scm/framework-eps.scm

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fix: file descriptor leak in scm/framework-eps.scm

Matthias Kilian
Found when trying to build on OpenBSD:

--- scm/framework-eps.scm.orig Fri Nov 10 14:44:26 2006
+++ scm/framework-eps.scm Mon Nov 13 21:53:37 2006
@@ -97,6 +97,8 @@ stencil, so LaTeX includegraphics doesn'
     (display "@c eof - 'eof' is a Makefile marker; do not remove. " texi-system-port)
     (display "% eof - 'eof' is Makefile marker; do not remove. " tex-system-port)
     
+    (close-output-port texi-system-port)
+    (close-output-port tex-system-port)
     (dump-infinite-stack-EPS stencils)
     (postprocess-output book framework-eps-module
  (format "~a.eps" basename) (ly:output-formats))))


--
Zesterdaz, all mz kezboards were so far awaz. (Beatles)
                -- Claus-Peter Warnecke, dtj, 12.3.2001


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Fix: file descriptor leak in scm/framework-eps.scm

Matthias Kilian
On Mon, Nov 13, 2006 at 11:48:18PM +0100, Matthias Kilian wrote:
> Found when trying to build on OpenBSD:

Fix another fd leak. To reproduce those leaks on Linux, try
ulimit -n 128 (or even 64) before running make all web.

BTW: this all is about LilyPond 2.10.0.


--- scm/backend-library.scm.orig Fri Nov 10 14:44:26 2006
+++ scm/backend-library.scm Tue Nov 14 22:02:42 2006
@@ -158,7 +158,9 @@
       (if (equal? "-" file-name) "<stdout>" file-name))
   (if (equal? file-name "-")
       (display value)
-      (display value (open-file file-name "w")))
+      (let ((port (open-file file-name "w")))
+        (display value port)
+  (close-port port)))
   (ly:progress "\n")
   "")
 
Ciao,
        Kili

ps: anyone using OpenBSD who wants to help please contact me offlist;
you'll need some patches not yet committed to the OpenBSD trees
(especially for makeinfo and guile, but also for LilyPond itself).


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel