Skip to content

Commit

Permalink
Merge pull request #114 from andrykonchin/ak/workaround-missing-SHARE…
Browse files Browse the repository at this point in the history
…_DELETE-on-truffleruby

Add workaround for TruffleRuby and do not use File::SHARE_DELETE
  • Loading branch information
hsbt authored Jan 10, 2025
2 parents 663a27f + 9f0afd8 commit e9af529
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/logger/log_device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ def reopen(log = nil)
# :stopdoc:

MODE = File::WRONLY | File::APPEND
MODE_TO_OPEN = MODE | File::SHARE_DELETE | File::BINARY
# temporary workaround for TruffleRuby
if File.const_defined? :SHARE_DELETE
MODE_TO_OPEN = MODE | File::SHARE_DELETE | File::BINARY
else
MODE_TO_OPEN = MODE | File::BINARY
end
MODE_TO_CREATE = MODE_TO_OPEN | File::CREAT | File::EXCL

def set_dev(log)
Expand Down

0 comments on commit e9af529

Please sign in to comment.