From db4338068a0360ac244d38938261451b76ad720a Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 16 Aug 2004 05:07:49 +0000 Subject: check constants (Fcntl::F_SETFL, Fcntl::F_GETFL and Fcntl::O_NONBLOCK) instead of trapping NotImplementedError. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_readpartial.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_readpartial.rb b/test/ruby/test_readpartial.rb index 2232068c1..526425dc5 100644 --- a/test/ruby/test_readpartial.rb +++ b/test/ruby/test_readpartial.rb @@ -17,12 +17,11 @@ class TestReadPartial < Test::Unit::TestCase make_pipe {|r, w| yield r, w } + return unless defined?(Fcntl::F_SETFL) + return unless defined?(Fcntl::F_GETFL) + return unless defined?(Fcntl::O_NONBLOCK) make_pipe {|r, w| - begin - r.fcntl(Fcntl::F_SETFL, r.fcntl(Fcntl::F_GETFL) | Fcntl::O_NONBLOCK) - rescue NotImplementedError - break - end + r.fcntl(Fcntl::F_SETFL, r.fcntl(Fcntl::F_GETFL) | Fcntl::O_NONBLOCK) yield r, w } end -- cgit