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.
This commit is contained in:
Ryan Tomayko 2009-02-23 22:48:21 -08:00
parent 2569e9fb5e
commit c180bc47bf
1 changed files with 1 additions and 0 deletions

View File

@ -65,6 +65,7 @@ class Albino
stdin.puts @target stdin.puts @target
stdin.close stdin.close
output = stdout.read.strip output = stdout.read.strip
[stdout, stderr].each { |io| io.close }
end end
output output
end end