diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-08-16 05:07:49 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-08-16 05:07:49 +0000 |
commit | 4339612a1462d4707f76e72d57a54a9cf9e27976 (patch) | |
tree | 82887583d3c1dcd9269969e248f6141c9c29317b | |
parent | e2e305605df3b79e1af040b7bad33641ba29e9e8 (diff) | |
download | ruby-4339612a1462d4707f76e72d57a54a9cf9e27976.tar.gz |
check constants (Fcntl::F_SETFL, Fcntl::F_GETFL and Fcntl::O_NONBLOCK)
instead of trapping NotImplementedError.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_readpartial.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/test/ruby/test_readpartial.rb b/test/ruby/test_readpartial.rb index 2232068c1b..526425dc57 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 |