From c180bc47bf2f63db1bff9f6600cccbe5ad69077e Mon Sep 17 00:00:00 2001 From: Ryan Tomayko Date: Mon, 23 Feb 2009 22:48:21 -0800 Subject: [PATCH] close open4 streams to prevent zombies The popen4 that execs pygmetize leaves a bunch of zombie processes around unless these streams are closed for some reason. It's not too bad when running jekyll in one-shot mode but when running with --server --auto --pygmentize, I eventually get "fork: resource not available" errors :/ Closing the streams let's the processes die while the parent stays running. --- lib/jekyll/albino.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/jekyll/albino.rb b/lib/jekyll/albino.rb index db59f2da..f452b329 100644 --- a/lib/jekyll/albino.rb +++ b/lib/jekyll/albino.rb @@ -65,6 +65,7 @@ class Albino stdin.puts @target stdin.close output = stdout.read.strip + [stdout, stderr].each { |io| io.close } end output end