[rubygems/rubygems] Do not use IO#flock on Solaris
`io.flock(File::LOCK_EX)` fails on Solaris when the io is opened as read-only. Due to this issue, `make install` of the ruby package failed on Solaris. https://github.com/rubygems/rubygems/commit/5905d17ab2
This commit is contained in:
parent
424800f707
commit
71e85ec9b5
@ -788,7 +788,7 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
||||
|
||||
def self.open_with_flock(path, flags, &block)
|
||||
File.open(path, flags) do |io|
|
||||
unless java_platform?
|
||||
if !java_platform? && !solaris_platform?
|
||||
begin
|
||||
io.flock(File::LOCK_EX)
|
||||
rescue Errno::ENOSYS, Errno::ENOTSUP
|
||||
@ -1015,6 +1015,13 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
|
||||
RUBY_PLATFORM == "java"
|
||||
end
|
||||
|
||||
##
|
||||
# Is this platform Solaris?
|
||||
|
||||
def self.solaris_platform?
|
||||
RUBY_PLATFORM =~ /solaris/
|
||||
end
|
||||
|
||||
##
|
||||
# Load +plugins+ as Ruby files
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user