about summary refs log tree commit homepage
path: root/test/helper.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-10-25 23:01:01 +0000
committerEric Wong <normalperson@yhbt.net>2013-10-25 23:02:01 +0000
commit025a67afc97ce65d30bebd61bedf20066d1874c6 (patch)
treeaf21ac8c5c724813eae56b188161c24955ca6638 /test/helper.rb
parent9bece9d13543743e2a0fdc6eab56c54098d4d0e6 (diff)
downloadyahns-025a67afc97ce65d30bebd61bedf20066d1874c6.tar.gz
We need to prevent FD leakage on Ruby 1.9.3
Diffstat (limited to 'test/helper.rb')
-rw-r--r--test/helper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/helper.rb b/test/helper.rb
index 730b96c..3f141e4 100644
--- a/test/helper.rb
+++ b/test/helper.rb
@@ -114,6 +114,10 @@ class IO
   end
 end if ! IO.method_defined?(:nread) && RUBY_PLATFORM =~ /linux/
 
+def cloexec_pipe
+  IO.pipe.each { |io| io.close_on_exec = true }
+end
+
 require 'yahns'
 
 # needed for parallel (MT) tests)