diff options
author | Pascal Terjan <pterjan@mageia.org> | 2012-12-11 00:53:06 +0000 |
---|---|---|
committer | Pascal Terjan <pterjan@mageia.org> | 2012-12-11 00:53:06 +0000 |
commit | 07a7f870fc8908bcef0c32988477ae99536d3ccb (patch) | |
tree | 3da94927a2dc97ae830bf660805523f22688efcb | |
parent | 18910a103bfd86e7686d1a8d0f30f329e95131fc (diff) | |
download | iurt-07a7f870fc8908bcef0c32988477ae99536d3ccb.tar iurt-07a7f870fc8908bcef0c32988477ae99536d3ccb.tar.gz iurt-07a7f870fc8908bcef0c32988477ae99536d3ccb.tar.bz2 iurt-07a7f870fc8908bcef0c32988477ae99536d3ccb.tar.xz iurt-07a7f870fc8908bcef0c32988477ae99536d3ccb.zip |
Add forgotten lock
-rwxr-xr-x | iurt | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); } } |