1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
akr 2004-08-16 05:07:49 +00:00
parent e2e305605d
commit 4339612a14

View file

@ -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