From 03a87d93b2539da7db0d3027589e291a2bf87ca5 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Tue, 23 Sep 2008 09:09:05 -0400 Subject: [PATCH] Use fileglob ref instead of STDERR bareword. Thanks to Chris Butler. --- check_postgres.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index 5ae17efff..8859502a4 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -28,7 +28,7 @@ $Data::Dumper::Varname = 'POSTGRES'; $Data::Dumper::Indent = 2; $Data::Dumper::Useqq = 1; -our $VERSION = '2.1.4'; +our $VERSION = '2.1.5'; use vars qw/ %opt $PSQL $res $COM $SQL $db /; @@ -916,7 +916,7 @@ sub run_command { alarm 0; my $start = $opt{showtime} ? [gettimeofday()] : 0; - open my $oldstderr, '>&', STDERR or ndie "Could not dupe STDERR\n"; + open my $oldstderr, '>&', \*STDERR or ndie "Could not dupe STDERR\n"; open STDERR, '>', $errorfile or ndie qq{Could not open STDERR?!\n}; eval { alarm $timeout; @@ -3292,7 +3292,7 @@ sub check_replicate_row { =head1 NAME B - a Postgres monitoring script for Nagios, MRTG, and others -This documents describes check_postgres.pl version 2.1.4 +This documents describes check_postgres.pl version 2.1.5 =head1 SYNOPSIS @@ -4364,6 +4364,10 @@ Items not specifically attributed are by Greg Sabino Mullane. =over 4 +=item B (September 23, 2008) + + Don't use STDERR bareword. (Chris Butler) + =item B (September 22, 2008) Fix for race condition in txn_time action. -- 2.39.5