aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/utils.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 2af1072c4..4099c4825 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -109,8 +109,10 @@ end
# prints no output
def quiet_system cmd, *args
Homebrew.system(cmd, *args) do
- $stdout.close
- $stderr.close
+ # Redirect output streams to `/dev/null` instead of closing as some programs
+ # will fail to execute if they can't write to an open stream.
+ $stdout.reopen('/dev/null')
+ $stderr.reopen('/dev/null')
end
end