From dd4ab9aedf7e7eaebddaf5c00f506972dad42b4c Mon Sep 17 00:00:00 2001 From: fox_two <> Date: Mon, 4 Jun 2001 15:19:02 +0000 Subject: [PATCH 1/1] print_month_as_HTML(): use locking for index-file --- selfforum-cgi/shared/Template/Archive.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/selfforum-cgi/shared/Template/Archive.pm b/selfforum-cgi/shared/Template/Archive.pm index ec5ee22..c71c359 100644 --- a/selfforum-cgi/shared/Template/Archive.pm +++ b/selfforum-cgi/shared/Template/Archive.pm @@ -73,7 +73,14 @@ sub print_month_as_HTML($$$) { my $template = new Template $tempfile; - my $threads = get_all_threads($mainfile, KILL_DELETED); + my ($threads, $locked); + unless ($locked = lock_file($mainfile) and $threads = get_all_threads($mainfile, KILL_DELETED)) { + print ${$template->scrap( + $assign->{'errorLocking'} + )}; + return; + } + unlock_file($mainfile); my $tmplparam = { $assign->{'year'} => $param->{'year'}, -- 2.34.1