Merge branch 'bzr/golem' of /Users/distler/Sites/code/instiki
This commit is contained in:
commit
f8c6c4410e
|
@ -72,7 +72,7 @@ module Rack
|
||||||
# access it because we have the file handle open.
|
# access it because we have the file handle open.
|
||||||
@rewindable_io = Tempfile.new('RackRewindableInput')
|
@rewindable_io = Tempfile.new('RackRewindableInput')
|
||||||
@rewindable_io.chmod(0000)
|
@rewindable_io.chmod(0000)
|
||||||
if filesystem_has_posix_semantics?
|
if filesystem_has_posix_semantics? && !tempfile_unlink_contains_bug?
|
||||||
@rewindable_io.unlink
|
@rewindable_io.unlink
|
||||||
@unlinked = true
|
@unlinked = true
|
||||||
end
|
end
|
||||||
|
@ -94,5 +94,15 @@ module Rack
|
||||||
def filesystem_has_posix_semantics?
|
def filesystem_has_posix_semantics?
|
||||||
RUBY_PLATFORM !~ /(mswin|mingw|cygwin|java)/
|
RUBY_PLATFORM !~ /(mswin|mingw|cygwin|java)/
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def tempfile_unlink_contains_bug?
|
||||||
|
# The tempfile library as included in Ruby 1.9.1-p152 and later
|
||||||
|
# contains a bug: unlinking an open Tempfile object also closes
|
||||||
|
# it, which breaks our expected POSIX semantics. This problem
|
||||||
|
# has been fixed in Ruby 1.9.2, but the Ruby team chose not to
|
||||||
|
# include the bug fix in later versions of the 1.9.1 series.
|
||||||
|
ruby_engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
|
||||||
|
ruby_engine == "ruby" && RUBY_VERSION == "1.9.1" && RUBY_PATCHLEVEL >= 152
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue