From 0526525c33ca4ad17eebd56ca0309922eb9fb15e Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 21 Jun 2023 19:30:50 -0700 Subject: [PATCH] runtests: work around a perl without SIGUSR1 At least msys2 perl v5.32.1 doesn't seem to define this signal. Since this signal is only used for debugging, just ignore if setting it fails. Reported-by: Marcel Raad Fixes #11350 Closes #11366 --- tests/runner.pm | 5 ++++- tests/runtests.pl | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/runner.pm b/tests/runner.pm index 94e28777e7..b1fe1854b0 100644 --- a/tests/runner.pm +++ b/tests/runner.pm @@ -189,7 +189,10 @@ sub runner_init { # TODO: set up better signal handlers $SIG{INT} = 'IGNORE'; $SIG{TERM} = 'IGNORE'; - $SIG{USR1} = 'IGNORE'; + eval { + # some msys2 perl versions don't define SIGUSR1 + $SIG{USR1} = 'IGNORE'; + }; $thisrunnerid = $$; print "Runner $thisrunnerid starting\n" if($verbose); diff --git a/tests/runtests.pl b/tests/runtests.pl index 7626912a54..c27fbfa227 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -271,7 +271,10 @@ sub catch_usr1 { } } -$SIG{USR1} = \&catch_usr1; +eval { + # some msys2 perl versions don't define SIGUSR1 + $SIG{USR1} = \&catch_usr1; +}; $SIG{PIPE} = 'IGNORE'; # these errors are captured in the read/write calls ##########################################################################