diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-28 12:02:33 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-28 12:02:33 +0900 |
commit | ff7f71b28889e043798dddfec568083cc7db204a (patch) | |
tree | 6f640c253e4931450dd55736ef7daee42ed23c78 | |
parent | 14b0c94ac38c40459d908fd4c5778efa60e4689f (diff) | |
download | ruby-ff7f71b28889e043798dddfec568083cc7db204a.tar.gz |
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.
-rw-r--r-- | io.c | 2 | ||||
-rw-r--r-- | test/objspace/test_objspace.rb | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -8037,7 +8037,7 @@ FILE * rb_io_stdio_file(rb_io_t *fptr) { 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)); } return fptr->stdio_file; diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index 983bd59e9a..602773b6cc 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -406,10 +406,10 @@ class TestObjSpace < Test::Unit::TestCase puts dump_my_heap_please end; - skip if /is not supported/ =~ error - skip error unless output - assert_match(entry, File.readlines(output).grep(/TEST STRING/).join("\n")) + assert_nil(error) + dump = File.readlines(output) File.unlink(output) + assert_match(entry, dump.grep(/TEST STRING/).join("\n")) end if defined?(JSON) |