Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2016-09-04 02:36:07 +0300
committerAhmad Sherif <me@ahmadsherif.com>2016-09-13 22:39:46 +0300
commitc90174afcd586b7652e527f4506b07ab833c7a87 (patch)
tree114c26526ca984e632b456babca09f7a70d1d8eb /lib/gitlab/popen.rb
parent5fdd92df39030ba4297189a274b8055fbca4b580 (diff)
Fix Gitlab::Popen.popen thread-safety issue
Fixes #21842
Diffstat (limited to 'lib/gitlab/popen.rb')
-rw-r--r--lib/gitlab/popen.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/gitlab/popen.rb b/lib/gitlab/popen.rb
index a0fd41161a5..cc74bb29087 100644
--- a/lib/gitlab/popen.rb
+++ b/lib/gitlab/popen.rb
@@ -18,18 +18,18 @@ module Gitlab
FileUtils.mkdir_p(path)
end
- @cmd_output = ""
- @cmd_status = 0
+ cmd_output = ""
+ cmd_status = 0
Open3.popen3(vars, *cmd, options) do |stdin, stdout, stderr, wait_thr|
yield(stdin) if block_given?
stdin.close
- @cmd_output << stdout.read
- @cmd_output << stderr.read
- @cmd_status = wait_thr.value.exitstatus
+ cmd_output << stdout.read
+ cmd_output << stderr.read
+ cmd_status = wait_thr.value.exitstatus
end
- [@cmd_output, @cmd_status]
+ [cmd_output, cmd_status]
end
end
end