summaryrefslogtreecommitdiff
path: root/lib/rubygems.rb
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-12-24 14:24:09 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-12-24 16:04:29 +0900
commit71e85ec9b5944238e14ac4e651247ecd0a98d27b (patch)
treefc6d4ce72719b85a12a49c41c4733809cce5a969 /lib/rubygems.rb
parent424800f70711433534d9669cb891dc828e7c7001 (diff)
[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
Diffstat (limited to 'lib/rubygems.rb')
-rw-r--r--lib/rubygems.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 762ecdf857..ddadd0f797 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -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
@@ -1016,6 +1016,13 @@ An Array (#{env.inspect}) was passed in from #{caller[3]}
end
##
+ # Is this platform Solaris?
+
+ def self.solaris_platform?
+ RUBY_PLATFORM =~ /solaris/
+ end
+
+ ##
# Load +plugins+ as Ruby files
def self.load_plugin_files(plugins) # :nodoc: