Skip to content

Commit

Permalink
Merge pull request rubygems#1588 from coldacid/master
Browse files Browse the repository at this point in the history
Survive EINVAL from File.open on Windows
  • Loading branch information
djberg96 committed Apr 25, 2016
2 parents 36d68c9 + 5f465d3 commit 26bf7e8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/rubygems/user_interaction.rb
Expand Up @@ -676,13 +676,8 @@ class Gem::SilentUI < Gem::StreamUI
def initialize
reader, writer = nil, nil

begin
reader = File.open('/dev/null', 'r')
writer = File.open('/dev/null', 'w')
rescue Errno::ENOENT
reader = File.open('nul', 'r')
writer = File.open('nul', 'w')
end
reader = File.open(Gem::Util::NULL_DEVICE, 'r')
writer = File.open(Gem::Util::NULL_DEVICE, 'w')

super reader, writer, writer, false
end
Expand Down

0 comments on commit 26bf7e8

Please sign in to comment.