From 07a7f870fc8908bcef0c32988477ae99536d3ccb Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Tue, 11 Dec 2012 00:53:06 +0000 Subject: Add forgotten lock --- iurt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/iurt b/iurt index 28a52b2..7ab127f 100755 --- a/iurt +++ b/iurt @@ -49,6 +49,7 @@ use File::Spec::Functions qw(rel2abs); use File::Basename qw(fileparse); # I did not manage to make locks work over the network #use File::lockf; +use Fcntl qw(:flock SEEK_END); use Mkcd::Commandline qw(parseCommandLine usage); use MDK::Common; use Filesys::Df qw(df); @@ -1414,7 +1415,10 @@ sub write_status { return unless $run{status}{$srpm}; my $status_file = status_file($local_spool, $run); if (open my $file, ">>$status_file") { + flock($file, LOCK_EX); + seek($file, 0, SEEK_END); print $file "$srpm: $run->{status}{$srpm}\n"; + flock($file, LOCK_UN); } } -- cgit v1.2.1