From aac156ccdf42d5170cc47470b150d76b28612c4c Mon Sep 17 00:00:00 2001 From: Caleb Xu Date: Sat, 13 Apr 2024 00:23:42 -0400 Subject: [PATCH] fork: pass error_pipe path to yielded block --- Library/Homebrew/utils/fork.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/utils/fork.rb b/Library/Homebrew/utils/fork.rb index 15cf1db4db..c6b06876db 100644 --- a/Library/Homebrew/utils/fork.rb +++ b/Library/Homebrew/utils/fork.rb @@ -37,15 +37,15 @@ module Utils pid = fork do # bootsnap doesn't like these forked processes ENV["HOMEBREW_NO_BOOTSNAP"] = "1" - - ENV["HOMEBREW_ERROR_PIPE"] = server.path + error_pipe = server.path + ENV["HOMEBREW_ERROR_PIPE"] = error_pipe server.close read.close write.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) Process::UID.change_privilege(Process.euid) if Process.euid != Process.uid - yield + yield(error_pipe) rescue Exception => e # rubocop:disable Lint/RescueException error_hash = JSON.parse e.to_json