1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

envutil.rb: not try to close pipes twice

This commit is contained in:
Nobuyoshi Nakada 2020-04-16 23:44:24 +09:00
parent fedc8075fe
commit e231f8e8a8
Notes: git 2020-04-17 00:53:07 +09:00

View file

@ -137,8 +137,10 @@ module EnvUtil
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