Skip to content

Commit

Permalink
Use ::File.unlink in place of Tempfile#unlink to avoid 1.9.1 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
raggi committed Jun 17, 2010
1 parent bf4593a commit dfb8aea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rack/rewindable_input.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def make_rewindable
@rewindable_io.set_encoding(Encoding::BINARY) if @rewindable_io.respond_to?(:set_encoding)
@rewindable_io.binmode
if filesystem_has_posix_semantics?
@rewindable_io.unlink
# Use ::File.unlink as 1.9.1 Tempfile has a bug where unlink closes the file!
::File.unlink @rewindable_io.path
raise 'Unlink failed. IO closed.' if @rewindable_io.closed?
@unlinked = true
end
Expand Down

0 comments on commit dfb8aea

Please sign in to comment.