CTRL-C for a child process should interrupt brew too

This commit is contained in:
Max Howell 2009-08-10 18:17:11 +01:00
parent dd7bdce89c
commit 480bfa3793

View File

@ -151,8 +151,11 @@ private
# Kernel.system but with exceptions
def safe_system cmd, *args
puts "#{cmd} #{args*' '}" if ARGV.verbose?
# stderr is shown, so hopefully that will explain the problem
raise ExecutionError.new(cmd, args) unless Kernel.system cmd, *args and $? == 0
execd=Kernel.system cmd, *args
# somehow Ruby doesn't handle the CTRL-C from another process -- WTF!?
raise Interrupt, cmd if $?.termsig == 2
raise ExecutionError.new(cmd, args) unless execd and $? == 0
end
def curl url, *args