if (!-e $serials_path) {
open(SERIALS,">$serials_path");
- flock(SERIALS,2); # Take exclusive lock
+ flock(SERIALS,LOCK_EX); # Take exclusive lock
} else {
open(SERIALS,"+<$serials_path");
- flock(SERIALS,2); # Take exclusive lock
+ flock(SERIALS,LOCK_EX); # Take exclusive lock
local *_;
while (<SERIALS>) {
s/\s+//g;
# Verify that this is really a new version of the file!
if (exists($serials{$full_filename})
&& ($serials{$full_filename} >= $new_epoch)) {
- flock(SERIALS,4); # Release lock
+ flock(SERIALS,LOCK_UN); # Release lock
throw signature_replay =>
previous_timestamp => $old_epoch, new_timestamp => $new_epoch
}
print SERIALS "$key:$serials{$key}\n";
}
- flock(SERIALS,4); # Release lock
+ flock(SERIALS,LOCK_UN); # Release lock
close(SERIALS);
flock $serials_flag, LOCK_UN or die "unlock serials flag: $!";
close $serials_flag or die "close serials flag: $!";