diff options
| author | Charlie Sharpsteen | 2012-07-06 12:56:18 -0800 |
|---|---|---|
| committer | Charlie Sharpsteen | 2012-07-09 09:21:33 -0800 |
| commit | 8a0c94d4e01361617eaacae6f26348ad59410d4d (patch) | |
| tree | f4e7d036363478247056ff269cbec929a8b54370 /Library | |
| parent | f17429f842222428d31095e0f604681764824afa (diff) | |
| download | brew-8a0c94d4e01361617eaacae6f26348ad59410d4d.tar.bz2 | |
quiet_system: Dump to /dev/null instead of closing
Some programs fail where they would otherwise succeed if stdout or stderr is
closed. For example, using mpicc from the mpich2 formula:
quiet_system 'mpicc', '--version'
Fails with:
LLVM ERROR: IO failure on output stream.
While
system 'mpicc', '--version'
Succeeds.
Closes Homebrew/homebrew#13253.
Signed-off-by: Charlie Sharpsteen <source@sharpsteen.net>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/utils.rb | 6 |
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 |
