diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 1322abc8d5..8fa86797fd 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -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