From 0d7f4690fe9b6d75bdd385f63707f7600ae89b80 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 5 Mar 2009 20:52:42 -0800 Subject: More checking for open() of log If log open fails, at least print the reason why. --- lib/Vyatta/Keepalived.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3