we don't want zombies running around
This commit is contained in:
parent
580d0ef7fc
commit
94eaea6339
14
lib/rocco.rb
14
lib/rocco.rb
@ -142,15 +142,17 @@ class Rocco
|
|||||||
# then fork off a child process to write the input.
|
# then fork off a child process to write the input.
|
||||||
code_html = nil
|
code_html = nil
|
||||||
open("|pygmentize -l ruby -f html", 'r+') do |fd|
|
open("|pygmentize -l ruby -f html", 'r+') do |fd|
|
||||||
fork {
|
pid =
|
||||||
fd.close_read
|
fork {
|
||||||
fd.write code_blocks.join("\n\n# DIVIDER\n\n")
|
fd.close_read
|
||||||
fd.close_write
|
fd.write code_blocks.join("\n\n# DIVIDER\n\n")
|
||||||
exit!
|
fd.close_write
|
||||||
}
|
exit!
|
||||||
|
}
|
||||||
fd.close_write
|
fd.close_write
|
||||||
code_html = fd.read
|
code_html = fd.read
|
||||||
fd.close_read
|
fd.close_read
|
||||||
|
Process.wait(pid)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Do some post-processing on the pygments output to split things back
|
# Do some post-processing on the pygments output to split things back
|
||||||
|
Loading…
Reference in New Issue
Block a user