From: Andrew Dunstan Date: Sun, 6 Oct 2024 14:34:45 +0000 (-0400) Subject: Move Cluster.pm initialization code to a more obvious place X-Git-Tag: REL_18_BETA1~1782 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=70fea390cfa71c438998993bebfb584effd3e7df;p=postgresql.git 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. --- 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)