[ruby/zlib] Clear temporary directory

https://github.com/ruby/zlib/commit/1bed54dcf7
This commit is contained in:
Nobuyoshi Nakada 2024-04-20 19:45:01 +09:00 committed by git
parent af169472c7
commit 2b11bcb84e

View File

@ -801,7 +801,8 @@ if defined? Zlib
gz.write "hi"
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.rewind
@ -825,6 +826,8 @@ if defined? Zlib
omit 'O_TMPFILE not supported (EISDIR)'
rescue Errno::EOPNOTSUPP
omit 'O_TMPFILE not supported (EOPNOTSUPP)'
ensure
Dir.rmdir(tmpdir) if tmpdir
end
end
end