script doesn't die on dbh->connect() failure
Bug #280989 reported by
Matthew
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mylvmbackup |
Fix Released
|
Medium
|
Lenz Grimmer |
Bug Description
Consider this code from mylvmbackup.pl:192
my $dbh= DBI->connect(
or log_msg ($DBI::errstr, LOG_ERR) && die $DBI::errstr;
On DBI->connect() failure, the log_msg() runs, but the die() does not. Code execution continues on to the next line which is run_hook(
Proposed fix. Verified correct behavior.
my $dbh = DBI->connect(
if(!$dbh)
{
log_msg ($DBI::errstr, LOG_ERR);
}
To post a comment you must log in.
Thanks for the suggestion - a fix for this was commited into the trunk some time ago, it will be part of the next release.