From: fox_two <> Date: Mon, 4 Jun 2001 15:19:02 +0000 (+0000) Subject: print_month_as_HTML(): use locking for index-file X-Git-Url: https://git.p6c8.net/selfforum.git/commitdiff_plain/dd4ab9aedf7e7eaebddaf5c00f506972dad42b4c?ds=sidebyside;hp=65d6cbd5043e3d211001db12bcf54efbd62a9cdb print_month_as_HTML(): use locking for index-file --- 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'},