Commit 37f90d5d authored by Douwe Maan's avatar Douwe Maan
Browse files

Make sure child processes get reaped after popen, again.

parent 8beb187e
Pipeline #16370 passed with stage
2.0.1
Make sure child processes get reaped after popen, again.
2.0.0
- Use safer shell commands and avoid Dir.chdir
- Restrict the environment for shell commands
......
......@@ -16,7 +16,10 @@ module Grack
end
def capture(cmd)
IO.popen(popen_env, cmd, popen_options).read
# _Not_ the same as `IO.popen(...).read`
# By using a block we tell IO.popen to close (wait for) the child process
# after we are done reading its output.
IO.popen(popen_env, cmd, popen_options) { |p| p.read }
end
def execute(cmd)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment