summaryrefslogtreecommitdiff
path: root/lib/securerandom.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/securerandom.rb')
-rw-r--r--lib/securerandom.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/securerandom.rb b/lib/securerandom.rb
index c26bf50b02..9c258603a6 100644
--- a/lib/securerandom.rb
+++ b/lib/securerandom.rb
@@ -40,7 +40,7 @@ end
# p SecureRandom.random_bytes(10) #=> "\016\t{\370g\310pbr\301"
# p SecureRandom.random_bytes(10) #=> "\323U\030TO\234\357\020\a\337"
module SecureRandom
- if !defined?(OpenSSL::Random) && /mswin|mingw/ =~ RUBY_PLATFORM
+ if /mswin|mingw/ =~ RUBY_PLATFORM
require "fiddle/import"
module AdvApi32 # :nodoc:
@@ -110,7 +110,7 @@ module SecureRandom
gen_random(n)
end
- if defined? OpenSSL::Random
+ if defined?(OpenSSL::Random) && !defined?(AdvApi32)
def self.gen_random(n)
@pid = 0 unless defined?(@pid)
pid = $$