[ruby/zlib] Clear temporary directory
https://github.com/ruby/zlib/commit/1bed54dcf7
This commit is contained in:
parent
af169472c7
commit
2b11bcb84e
@ -801,7 +801,8 @@ if defined? Zlib
|
|||||||
gz.write "hi"
|
gz.write "hi"
|
||||||
gz.close
|
gz.close
|
||||||
|
|
||||||
File.open(Dir.mktmpdir, File::RDWR | File::TMPFILE) do |io|
|
tmpdir = Dir.mktmpdir("zlib_file_tmpfile")
|
||||||
|
File.open(tmpdir, File::RDWR | File::TMPFILE) do |io|
|
||||||
io.write sio.string
|
io.write sio.string
|
||||||
io.rewind
|
io.rewind
|
||||||
|
|
||||||
@ -825,6 +826,8 @@ if defined? Zlib
|
|||||||
omit 'O_TMPFILE not supported (EISDIR)'
|
omit 'O_TMPFILE not supported (EISDIR)'
|
||||||
rescue Errno::EOPNOTSUPP
|
rescue Errno::EOPNOTSUPP
|
||||||
omit 'O_TMPFILE not supported (EOPNOTSUPP)'
|
omit 'O_TMPFILE not supported (EOPNOTSUPP)'
|
||||||
|
ensure
|
||||||
|
Dir.rmdir(tmpdir) if tmpdir
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user