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

ruby-changes:60798

From: Nobuyoshi <ko1@a...>
Date: Fri, 17 Apr 2020 00:52:51 +0900 (JST)
Subject: [ruby-changes:60798] e231f8e8a8 (master): envutil.rb: not try to close pipes twice

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

From e231f8e8a8659bab7f8ef9992c6b36b8683fb8aa Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 16 Apr 2020 23:44:24 +0900
Subject: envutil.rb: not try to close pipes twice


diff --git a/tool/lib/envutil.rb b/tool/lib/envutil.rb
index 2faf483..07d76c0 100644
--- a/tool/lib/envutil.rb
+++ b/tool/lib/envutil.rb
@@ -137,8 +137,10 @@ module EnvUtil https://github.com/ruby/ruby/blob/trunk/tool/lib/envutil.rb#L137
     args = [args] if args.kind_of?(String)
     pid = spawn(child_env, *precommand, rubybin, *args, **opt)
     in_c.close
-    out_c.close if capture_stdout
-    err_c.close if capture_stderr && capture_stderr != :merge_to_stdout
+    out_c&.close
+    out_c = nil
+    err_c&.close
+    err_c = nil
     if block_given?
       return yield in_p, out_p, err_p, pid
     else
-- 
cgit v0.10.2


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

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