O_EXCL has no meaning for fdopen
"exclusive access mode is not supported" exception has resulted in empty "rubyheap-*.json" files after test/objspace/test_objspace.rb.
This commit is contained in:
parent
14b0c94ac3
commit
ff7f71b288
2
io.c
2
io.c
@ -8037,7 +8037,7 @@ FILE *
|
|||||||
rb_io_stdio_file(rb_io_t *fptr)
|
rb_io_stdio_file(rb_io_t *fptr)
|
||||||
{
|
{
|
||||||
if (!fptr->stdio_file) {
|
if (!fptr->stdio_file) {
|
||||||
int oflags = rb_io_fmode_oflags(fptr->mode);
|
int oflags = rb_io_fmode_oflags(fptr->mode) & ~O_EXCL;
|
||||||
fptr->stdio_file = rb_fdopen(fptr->fd, rb_io_oflags_modestr(oflags));
|
fptr->stdio_file = rb_fdopen(fptr->fd, rb_io_oflags_modestr(oflags));
|
||||||
}
|
}
|
||||||
return fptr->stdio_file;
|
return fptr->stdio_file;
|
||||||
|
@ -406,10 +406,10 @@ class TestObjSpace < Test::Unit::TestCase
|
|||||||
|
|
||||||
puts dump_my_heap_please
|
puts dump_my_heap_please
|
||||||
end;
|
end;
|
||||||
skip if /is not supported/ =~ error
|
assert_nil(error)
|
||||||
skip error unless output
|
dump = File.readlines(output)
|
||||||
assert_match(entry, File.readlines(output).grep(/TEST STRING/).join("\n"))
|
|
||||||
File.unlink(output)
|
File.unlink(output)
|
||||||
|
assert_match(entry, dump.grep(/TEST STRING/).join("\n"))
|
||||||
end
|
end
|
||||||
|
|
||||||
if defined?(JSON)
|
if defined?(JSON)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user