mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-21 02:00:45 +08:00
CleanupTasks: Older Perl compat
This commit is contained in:
@@ -5650,9 +5650,9 @@ sub DESTROY {
|
|||||||
my $task = $self->{task};
|
my $task = $self->{task};
|
||||||
if ( ref $task ) {
|
if ( ref $task ) {
|
||||||
PTDEBUG && _d('Calling cleanup task', $task);
|
PTDEBUG && _d('Calling cleanup task', $task);
|
||||||
open local *STDOUT, ">&=", $self->{stdout_copy}
|
open local(*STDOUT), ">&=", $self->{stdout_copy}
|
||||||
if $self->{stdout_copy};
|
if $self->{stdout_copy};
|
||||||
open local *STDERR, ">&=", $self->{stderr_copy}
|
open local(*STDERR), ">&=", $self->{stderr_copy}
|
||||||
if $self->{stderr_copy};
|
if $self->{stderr_copy};
|
||||||
$task->();
|
$task->();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,9 +57,9 @@ sub DESTROY {
|
|||||||
PTDEBUG && _d('Calling cleanup task', $task);
|
PTDEBUG && _d('Calling cleanup task', $task);
|
||||||
# Temporarily restore STDOUT and STDERR to what they were
|
# Temporarily restore STDOUT and STDERR to what they were
|
||||||
# when the object was created
|
# when the object was created
|
||||||
open local *STDOUT, ">&=", $self->{stdout_copy}
|
open local(*STDOUT), ">&=", $self->{stdout_copy}
|
||||||
if $self->{stdout_copy};
|
if $self->{stdout_copy};
|
||||||
open local *STDERR, ">&=", $self->{stderr_copy}
|
open local(*STDERR), ">&=", $self->{stderr_copy}
|
||||||
if $self->{stderr_copy};
|
if $self->{stderr_copy};
|
||||||
$task->();
|
$task->();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user