my $new_epoch = shift;
my $serials_path = File::Spec->catfile(CONF_DIR_State, 'serials');
+ my $serials_flag_name = File::Spec->catfile(CONF_DIR_State, 'serials.flag');
+
+ open my $serials_flag, '>', $serials_flag_name
+ or die "open serials flag: $!";
+ flock $serials_flag, LOCK_EX
+ or die "lock serials flag: $!";
# Now we need to flock the our 'serials' file;
# verify the epoch value there/update it, etc.
flock(SERIALS,4); # Release lock
close(SERIALS);
+ flock $serials_flag, LOCK_UN or die "unlock serials flag: $!";
+ close $serials_flag or die "close serials flag: $!";
return $old_epoch;
}