From 70fea390cfa71c438998993bebfb584effd3e7df Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Sun, 6 Oct 2024 10:34:45 -0400 Subject: [PATCH] Move Cluster.pm initialization code to a more obvious place Commit 460c0076e8 added some module intialization code to set signal handlers. However, that code has now become somewhat buried, as later commits added new subroutines. Therefore, move the initialization code to the module's INIT block where it won't become obscured. --- src/test/perl/PostgreSQL/Test/Cluster.pm | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm index 90a842f96ab..30857f34bff 100644 --- a/src/test/perl/PostgreSQL/Test/Cluster.pm +++ b/src/test/perl/PostgreSQL/Test/Cluster.pm @@ -175,6 +175,11 @@ INIT $portdir =~ s!\\!/!g; # Make sure the directory exists mkpath($portdir) unless -d $portdir; + + # + # Signal handlers + # + $SIG{TERM} = $SIG{INT} = sub { die "death by signal"; }; } =pod @@ -3350,13 +3355,6 @@ sub corrupt_page_checksum return; } -# -# Signal handlers -# -$SIG{TERM} = $SIG{INT} = sub { - die "death by signal"; -}; - =pod =item $node->log_standby_snapshot(self, standby, slot_name)