From 9da32e3d930b3769aab13d3e0cf504c34381490d Mon Sep 17 00:00:00 2001
From: Michka Popoff <michkapopoff@gmail.com>
Date: Tue, 22 Sep 2020 23:35:10 +0200
Subject: [PATCH] test: make pgrep call portable

Fixes (on linux), for example for the ninja formula test:

```
pgrep
-P
83252
{out: :close}}
Invalid preceding regular expressionpgrep: write error: Bad file descriptor
Error: ninja: failed
An exception occurred within a child process:
  BuildError: Failed executing: pgrep -P 83252 {out: :close}
```

Using File:NULL is more portable.
---
 Library/Homebrew/test.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Library/Homebrew/test.rb b/Library/Homebrew/test.rb
index fc09ba2e9f..aad5e5bb2a 100644
--- a/Library/Homebrew/test.rb
+++ b/Library/Homebrew/test.rb
@@ -46,7 +46,7 @@ rescue Exception => e # rubocop:disable Lint/RescueException
   error_pipe.close
 ensure
   pid = Process.pid.to_s
-  if which("pgrep") && which("pkill") && system("pgrep", "-P", pid, out: :close)
+  if which("pgrep") && which("pkill") && system("pgrep", "-P", pid, :out => File::NULL)
     $stderr.puts "Killing child processes..."
     system "pkill", "-P", pid
     sleep 1
-- 
GitLab