From f760df95c778c6d519c4bc49bdb4cea57713f6b1 Mon Sep 17 00:00:00 2001 From: Mikael Nordin Date: Thu, 15 Sep 2016 10:56:10 +0200 Subject: [PATCH] Update cluster_cron.pl --- cluster_cron.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cluster_cron.pl b/cluster_cron.pl index 954668a..fdd0d72 100755 --- a/cluster_cron.pl +++ b/cluster_cron.pl @@ -79,7 +79,7 @@ sub get_nodes { # Simply write a unix timestamp to a file with our name on it sub write_timestamp { my $time = time; - open(FILE,"+>$electiondir/$hostname"); + open(FILE,"+>$electiondir/$hostname") or die "Could not open file: $!"; print FILE $time; close FILE; @@ -108,7 +108,7 @@ sub is_active { } else { print "I am active\n"; my $outfile = "$sharedcrondir/active"; - open(OUTFILE,"+>$outfile"); + open(OUTFILE,"+>$outfile") or die "Could not open file: $!"; print OUTFILE $hostname; close OUTFILE; } @@ -142,7 +142,7 @@ sub comment_out { } close INFILE; - open(OUTFILE,"+>$outfile"); + open(OUTFILE,"+>$outfile") or die "Could not open file: $!"; print OUTFILE $content; close OUTFILE; @@ -159,7 +159,7 @@ sub uncomment { } close INFILE; - open(OUTFILE,"+>$outfile"); + open(OUTFILE,"+>$outfile") or die "Could not open file: $!"; print OUTFILE $content; close OUTFILE;