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/test_wbuf.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/test_wbuf.rb') diff --git a/test/test_wbuf.rb b/test/test_wbuf.rb index 0923eb0..44ac74e 100644 --- a/test/test_wbuf.rb +++ b/test/test_wbuf.rb @@ -16,7 +16,7 @@ class TestWbuf < Testcase assert_equal "HIHI", b.read(4) nr.times { wbuf.wbuf_write(a, buf) } assert_equal :wait_writable, wbuf.wbuf_flush(a) - done = IO.pipe + done = cloexec_pipe thr = Thread.new do rv = [] until rv[-1] == persist @@ -86,7 +86,7 @@ class TestWbuf < Testcase end def test_wbuf_flush_close - pipe = IO.pipe + pipe = cloexec_pipe persist = true wbuf = Yahns::Wbuf.new(pipe[0], persist) refute wbuf.respond_to?(:close) # we don't want this for HttpResponse body @@ -103,7 +103,7 @@ class TestWbuf < Testcase assert_equal thr, thr.join(5) assert_equal :wait_writable, rv - done = IO.pipe + done = cloexec_pipe thr = Thread.new do rv = [] until rv[-1] == persist -- cgit v1.2.3-24-ge0c7