summaryrefslogtreecommitdiff
path: root/lib/Vyatta
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@vyatta.com>2009-03-05 20:52:42 -0800
committerStephen Hemminger <shemminger@vyatta.com>2009-03-05 20:52:42 -0800
commit0d7f4690fe9b6d75bdd385f63707f7600ae89b80 (patch)
tree105b69517c18db108189b6766357eee8e312e988 /lib/Vyatta
parentc7c87966d44fab325724b5547b228664813c2160 (diff)
downloadvyatta-cfg-quagga-0d7f4690fe9b6d75bdd385f63707f7600ae89b80.tar.gz
vyatta-cfg-quagga-0d7f4690fe9b6d75bdd385f63707f7600ae89b80.zip
More checking for open() of log
If log open fails, at least print the reason why.
Diffstat (limited to 'lib/Vyatta')
-rwxr-xr-xlib/Vyatta/Keepalived.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Vyatta/Keepalived.pm b/lib/Vyatta/Keepalived.pm
index 1f3c2592..fafaafe1 100755
--- a/lib/Vyatta/Keepalived.pm
+++ b/lib/Vyatta/Keepalived.pm
@@ -44,7 +44,8 @@ my $vrrp_log = "$state_dir/vrrp.log";
sub vrrp_log {
my $timestamp = strftime("%Y%m%d-%H:%M.%S", localtime);
- open my $fh, ">>", $vrrp_log;
+ open my $fh, '>>', $vrrp_log
+ or die "Can't open $vrrp_log:$!";
print $fh "$timestamp: ", @_ , "\n";
close $fh;
}