diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Fatal.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Fatal.pm | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/Master/tlpkg/tlperl/lib/Fatal.pm b/Master/tlpkg/tlperl/lib/Fatal.pm index 16e17434742..09abfb8536d 100644 --- a/Master/tlpkg/tlperl/lib/Fatal.pm +++ b/Master/tlpkg/tlperl/lib/Fatal.pm @@ -8,7 +8,7 @@ use strict; use warnings; use Tie::RefHash; # To cache subroutine refs use Config; -use Scalar::Util qw(set_prototype); +use Scalar::Util qw(set_prototype looks_like_number); use autodie::Util qw( fill_protos @@ -55,7 +55,7 @@ use constant ERROR_58_HINTS => q{Non-subroutine %s hints for %s are not supporte use constant MIN_IPC_SYS_SIMPLE_VER => 0.12; -our $VERSION = '2.29'; # VERSION: Generated by DZP::OurPkg::Version +our $VERSION = '2.32'; # VERSION: Generated by DZP::OurPkg::Version our $Debug ||= 0; @@ -165,6 +165,9 @@ my %TAGS = ( ':2.27' => [qw(:default)], ':2.28' => [qw(:default)], ':2.29' => [qw(:default)], + ':2.30' => [qw(:default)], + ':2.31' => [qw(:default)], + ':2.32' => [qw(:default)], ); @@ -580,7 +583,12 @@ sub unimport { # Record the current sub to be reinstalled at end of scope # and then restore the original (can be undef for "CORE::" # subs) - $reinstall_subs{$symbol} = \&$sub; + + { + no strict 'refs'; ## no critic # to avoid: Can't use string (...) as a symbol ref ... + $reinstall_subs{$symbol} = \&$sub + if exists ${"${pkg}::"}{$symbol}; + } $uninstall_subs{$symbol} = $Original_user_sub{$sub}; } @@ -1023,6 +1031,26 @@ sub _one_invocation { }; } + if ($call eq 'CORE::kill') { + + return qq[ + + my \$num_things = \@_ - $Returns_num_things_changed{$call}; + my \$context = ! defined wantarray() ? 'void' : 'scalar'; + my \$signal = \$_[0]; + my \$retval = $call(@argv); + my \$sigzero = looks_like_number( \$signal ) && \$signal == 0; + + if ( ( \$sigzero && \$context eq 'void' ) + or ( ! \$sigzero && \$retval != \$num_things ) ) { + + $die; + } + + return \$retval; + ]; + } + if (exists $Returns_num_things_changed{$call}) { # Some things return the number of things changed (like |