diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-04 01:09:09 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-04 01:09:09 +0000 |
commit | e98a3f15a5ec2fd2b1b825dc6ccc04d6b3d1e94a (patch) | |
tree | bee8281605198807f5edd22cd843917442607c3f /ext/openssl | |
parent | ffa44cfe416178217fc5b345dcc551d7c2313f34 (diff) | |
download | ruby-e98a3f15a5ec2fd2b1b825dc6ccc04d6b3d1e94a.tar.gz |
ext/openssl/lib/openssl/ssl.rb: use io/nonblock instead of fcntl
[ruby-core:69382] [Feature #11190]
IO#nonblock= is easier-to-read, potentially more portable, and
avoids redundantly setting flags.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl')
-rw-r--r-- | ext/openssl/lib/openssl/ssl.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/openssl/lib/openssl/ssl.rb b/ext/openssl/lib/openssl/ssl.rb index 0cab141e24..cc956fa6b5 100644 --- a/ext/openssl/lib/openssl/ssl.rb +++ b/ext/openssl/lib/openssl/ssl.rb @@ -15,7 +15,7 @@ =end require "openssl/buffering" -require "fcntl" +require "io/nonblock" module OpenSSL module SSL @@ -126,9 +126,7 @@ module OpenSSL module Nonblock def initialize(*args) - flag = File::NONBLOCK - flag |= @io.fcntl(Fcntl::F_GETFL) if defined?(Fcntl::F_GETFL) - @io.fcntl(Fcntl::F_SETFL, flag) + @io.nonblock = true if @io.respond_to?(:nonblock=) super end end |