Permalink
Browse files

Workaround for Process.spawn not auto-closing fds

  • Loading branch information...
1 parent 2bd49f5 commit a77e4f5cc4853a143c2a2fbf1780323a86e22688 @jfirebaugh jfirebaugh committed May 7, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/19/open3.rb
View
@@ -199,6 +199,7 @@ def popen2e(*cmd, &block)
module_function :popen2e
def popen_run(cmd, opts, child_io, parent_io) # :nodoc:
+ parent_io.each {|io| io.close_on_exec = true }
pid = spawn(*cmd, opts)
wait_thr = Process.detach(pid)
child_io.each {|io| io.close }

0 comments on commit a77e4f5

Please sign in to comment.