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:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-01-22 17:53:16 +0300
committerJacob Vosmaer <contact@jacobvosmaer.nl>2015-01-22 17:53:16 +0300
commita63187f28b18e2feea16681b313166a982254e4e (patch)
treee62e584be1f15c48a6da7088202286eeb8e4ee16
parentf937e059493037f3e18896a81693de81cf6a69a1 (diff)
Don't create zombies with IO.popen
The previous recommend incantation would leave the process we read from hanging around, even though it had finished. That gives you a 'defunct'/'zombie' process.
-rw-r--r--doc/development/shell_commands.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/development/shell_commands.md b/doc/development/shell_commands.md
index 1e51ad73e32..42f17e19536 100644
--- a/doc/development/shell_commands.md
+++ b/doc/development/shell_commands.md
@@ -108,7 +108,7 @@ In other repositories, such as gitlab-shell you can also use `IO.popen`.
```ruby
# Safe IO.popen example
-logs = IO.popen(%W(git log), chdir: repo_dir).read
+logs = IO.popen(%W(git log), chdir: repo_dir) { |p| p.read }
```
Note that unlike `Gitlab::Popen.popen`, `IO.popen` does not capture standard error.