Skip to content

Commit 8ec366b

Browse files
authored
Merge pull request #1032 from haarg/no-can-sigsys
calculate CAN_SIGSYS when called rather than as a constant
2 parents 8e80a95 + 1653a15 commit 8ec366b

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

lib/Test2/API/Instance.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ our @CARP_NOT = qw/Test2::API Test2::API::Instance Test2::IPC::Driver Test2::For
88
use Carp qw/confess carp/;
99
use Scalar::Util qw/reftype/;
1010

11-
use Test2::Util qw/get_tid USE_THREADS CAN_FORK pkg_to_file try CAN_SIGSYS/;
11+
use Test2::Util qw/get_tid USE_THREADS CAN_FORK pkg_to_file try/;
1212

1313
use Test2::EventFacet::Trace();
1414
use Test2::API::Stack();

lib/Test2/Util.pm

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,12 @@ sub _check_for_sig_sys {
166166
return $sig_list =~ m/\bSYS\b/;
167167
}
168168

169-
BEGIN {
170-
if (_check_for_sig_sys($Config{sig_name})) {
171-
*CAN_SIGSYS = sub() { 1 };
172-
}
173-
else {
174-
*CAN_SIGSYS = sub() { 0 };
169+
my $CAN_SIGSYS;
170+
sub CAN_SIGSYS () {
171+
if (!defined $CAN_SIGSYS) {
172+
$CAN_SIGSYS = _check_for_sig_sys($Config{sig_name});
175173
}
174+
$CAN_SIGSYS;
176175
}
177176

178177
my %PERLIO_SKIP = (

0 commit comments

Comments
 (0)