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

Write stdin_data only if it exists

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2013-06-17 10:24:48 +00:00
parent ba49a1e025
commit 809013566e

View file

@ -62,7 +62,7 @@ module EnvUtil
else
th_stdout = Thread.new { out_p.read } if capture_stdout
th_stderr = Thread.new { err_p.read } if capture_stderr && capture_stderr != :merge_to_stdout
in_p.write stdin_data.to_str
in_p.write stdin_data.to_str unless stdin_data.empty?
in_p.close
if (!th_stdout || th_stdout.join(timeout)) && (!th_stderr || th_stderr.join(timeout))
stdout = th_stdout.value if capture_stdout