Add comment about error pipe (mis)behavior

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-06-15 14:45:57 -05:00
parent f9b2761d77
commit 1b6f23c8a9

View File

@ -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)