summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorHenrik Ahlgren2012-09-14 07:11:20 +0000
committerGreg Sabino Mullane2013-02-11 20:03:09 +0000
commita725602365ea40180a06a73107f7f7995367659c (patch)
treea5815b09d29561b33b9187f37ba10f0b16458ac0 /check_postgres.pl
parentfc1e65922a90e2eb553f2f3304359e0174718243 (diff)
Get rid of "uninitialized value" warnings.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index 7a2d48f11..d62dc8178 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -2251,7 +2251,7 @@ sub run_command {
$ENV{PGSERVICE} = $db->{dbservice};
}
else {
- $db->{pname} = "port=$db->{port} host=$db->{host} db=$db->{dbname} user=$db->{dbuser}";
+ $db->{pname} = "port=" . ($db->{port} || $opt{defaultport}) . " host=$db->{host} db=$db->{dbname} user=$db->{dbuser}";
}
## If all we want is a connection string, give it and leave now