mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 05:25:34 +02:00
* lib/logger.rb (Logger::LogDevice#open_logfile, #create_logfile):
Logger should be able to open only files [Bug #14212] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2c075d3863
commit
7176eb2df9
2 changed files with 9 additions and 2 deletions
|
@ -743,7 +743,7 @@ private
|
|||
|
||||
def open_logfile(filename)
|
||||
begin
|
||||
open(filename, (File::WRONLY | File::APPEND))
|
||||
File.open(filename, (File::WRONLY | File::APPEND))
|
||||
rescue Errno::ENOENT
|
||||
create_logfile(filename)
|
||||
end
|
||||
|
@ -751,7 +751,7 @@ private
|
|||
|
||||
def create_logfile(filename)
|
||||
begin
|
||||
logdev = open(filename, (File::WRONLY | File::APPEND | File::CREAT | File::EXCL))
|
||||
logdev = File.open(filename, (File::WRONLY | File::APPEND | File::CREAT | File::EXCL))
|
||||
logdev.flock(File::LOCK_EX)
|
||||
logdev.sync = true
|
||||
add_log_header(logdev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue