aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2012-12-11 00:53:06 +0000
committerPascal Terjan <pterjan@mageia.org>2012-12-11 00:53:06 +0000
commit07a7f870fc8908bcef0c32988477ae99536d3ccb (patch)
tree3da94927a2dc97ae830bf660805523f22688efcb
parent18910a103bfd86e7686d1a8d0f30f329e95131fc (diff)
downloadiurt-07a7f870fc8908bcef0c32988477ae99536d3ccb.tar
iurt-07a7f870fc8908bcef0c32988477ae99536d3ccb.tar.gz
iurt-07a7f870fc8908bcef0c32988477ae99536d3ccb.tar.bz2
iurt-07a7f870fc8908bcef0c32988477ae99536d3ccb.tar.xz
iurt-07a7f870fc8908bcef0c32988477ae99536d3ccb.zip
Add forgotten lock
-rwxr-xr-xiurt4
1 files changed, 4 insertions, 0 deletions
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);
}
}