Future-proof the build process fork/wait
This commit is contained in:
parent
809c804499
commit
fcb9c4d5fb
@ -490,7 +490,7 @@ class FormulaInstaller
|
|||||||
# to remain open in the child process.
|
# to remain open in the child process.
|
||||||
args << { write => write } if RUBY_VERSION >= "2.0"
|
args << { write => write } if RUBY_VERSION >= "2.0"
|
||||||
|
|
||||||
fork do
|
pid = fork do
|
||||||
begin
|
begin
|
||||||
read.close
|
read.close
|
||||||
exec(*args)
|
exec(*args)
|
||||||
@ -501,9 +501,9 @@ class FormulaInstaller
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ignore_interrupts(:quietly) do # the fork will receive the interrupt and marshall it back
|
ignore_interrupts(:quietly) do # the child will receive the interrupt and marshal it back
|
||||||
write.close
|
write.close
|
||||||
Process.wait
|
Process.wait(pid)
|
||||||
data = read.read
|
data = read.read
|
||||||
read.close
|
read.close
|
||||||
raise Marshal.load(data) unless data.nil? or data.empty?
|
raise Marshal.load(data) unless data.nil? or data.empty?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user