Make sure we wait for the correct child

Fixes Homebrew/homebrew#27962.
This commit is contained in:
Jack Nagel 2014-03-29 02:24:01 -05:00
parent c27eed10bd
commit 809c804499

View File

@ -95,13 +95,13 @@ end
module Homebrew
def self.system cmd, *args
puts "#{cmd} #{args*' '}" if ARGV.verbose?
fork do
pid = fork do
yield if block_given?
args.collect!{|arg| arg.to_s}
exec(cmd.to_s, *args) rescue nil
exit! 1 # never gets here unless exec failed
end
Process.wait
Process.wait(pid)
$?.success?
end
end