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:
parent
e2e305605d
commit
4339612a14
@ -17,12 +17,11 @@ class TestReadPartial < Test::Unit::TestCase
|
|||||||
make_pipe {|r, w|
|
make_pipe {|r, w|
|
||||||
yield 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|
|
make_pipe {|r, w|
|
||||||
begin
|
|
||||||
r.fcntl(Fcntl::F_SETFL, r.fcntl(Fcntl::F_GETFL) | Fcntl::O_NONBLOCK)
|
r.fcntl(Fcntl::F_SETFL, r.fcntl(Fcntl::F_GETFL) | Fcntl::O_NONBLOCK)
|
||||||
rescue NotImplementedError
|
|
||||||
break
|
|
||||||
end
|
|
||||||
yield r, w
|
yield r, w
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user