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.
This commit is contained in:
parent
36226debb5
commit
9da32e3d93
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user