diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-12-17 14:18:11 +0300 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2015-01-05 13:51:21 +0300 |
commit | 52bc4e79f83e56f7f90563aa2bd97b98b4cc2715 (patch) | |
tree | c5795299d9f7baddd53ccd8780cc31a84723633c /lib/gitlab | |
parent | 5dbbec4612d12d00d9db6ad057044054b923817f (diff) |
Close standard input in Gitlab::Popen.popen
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/popen.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/gitlab/popen.rb b/lib/gitlab/popen.rb index e2fbafb3899..fea4d2d55d2 100644 --- a/lib/gitlab/popen.rb +++ b/lib/gitlab/popen.rb @@ -21,6 +21,9 @@ module Gitlab @cmd_output = "" @cmd_status = 0 Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr| + # We are not using stdin so we should close it, in case the command we + # are running waits for input. + stdin.close @cmd_output << stdout.read @cmd_output << stderr.read @cmd_status = wait_thr.value.exitstatus |