From 1b6f23c8a96fcb78163ba5a58a5e0e342d390663 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 15 Jun 2012 14:45:57 -0500 Subject: Add comment about error pipe (mis)behavior Signed-off-by: Jack Nagel --- Library/Homebrew/build.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Library') diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index a818cc556..b237fc447 100755 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -32,6 +32,12 @@ at_exit do # can be inconvenient for the user. But we need to be safe. system "/usr/bin/sudo -k" + # The main Homebrew process expects to eventually see EOF on the error + # pipe in FormulaInstaller#build. However, if any child process fails to + # terminate (i.e, fails to close the descriptor), this won't happen, and + # the installer will hang. Set close-on-exec to prevent this. + # Whether it is *wise* to launch daemons from formulae is a separate + # question altogether. if ENV['HOMEBREW_ERROR_PIPE'] require 'fcntl' IO.new(ENV['HOMEBREW_ERROR_PIPE'].to_i, 'w').fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) -- cgit v1.2.3