From 025a67afc97ce65d30bebd61bedf20066d1874c6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 25 Oct 2013 23:01:01 +0000 Subject: enforce FD_CLOEXEC on all pipes, including tests We need to prevent FD leakage on Ruby 1.9.3 --- test/helper.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/helper.rb') 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) -- cgit v1.2.3-24-ge0c7