[前][次][番号順一覧][スレッド一覧]

ruby-changes:56240

From: Nobuyoshi <ko1@a...>
Date: Fri, 28 Jun 2019 12:07:48 +0900 (JST)
Subject: [ruby-changes:56240] Nobuyoshi Nakada: ff7f71b288 (trunk): O_EXCL has no meaning for fdopen

https://git.ruby-lang.org/ruby.git/commit/?id=ff7f71b288

From ff7f71b28889e043798dddfec568083cc7db204a Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 28 Jun 2019 12:02:33 +0900
Subject: 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.

diff --git a/io.c b/io.c
index 0db981e..5e04da8 100644
--- a/io.c
+++ b/io.c
@@ -8037,7 +8037,7 @@ FILE * https://github.com/ruby/ruby/blob/trunk/io.c#L8037
 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 983bd59..602773b 100644
--- a/test/objspace/test_objspace.rb
+++ b/test/objspace/test_objspace.rb
@@ -406,10 +406,10 @@ class TestObjSpace < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L406
 
         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)
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]