X-Git-Url: https://git.p6c8.net/selfforum.git/blobdiff_plain/ce34f7e9e1943ea798985e84560beab23d36fd31..e0e1833d60647df91b471bff59ba257fa202eb36:/selfforum-cgi/shared/Conf/Admin.pm diff --git a/selfforum-cgi/shared/Conf/Admin.pm b/selfforum-cgi/shared/Conf/Admin.pm index 5d07736..ac0d8dc 100644 --- a/selfforum-cgi/shared/Conf/Admin.pm +++ b/selfforum-cgi/shared/Conf/Admin.pm @@ -4,7 +4,7 @@ package Conf::Admin; # # # File: shared/CheckRFC.pm # # # -# Authors: Andre Malo , 2001-06-16 # +# Authors: André Malo # # # # Description: read and parse admin default config # # # @@ -13,10 +13,9 @@ package Conf::Admin; use strict; use vars qw( @EXPORT - $VERSION ); -use Lock qw(:READ); +use Lock; use XML::DOM; @@ -24,7 +23,11 @@ use XML::DOM; # # Version check # -$VERSION = do { my @r =(q$Revision$ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; +# last modified: +# $Date$ (GMT) +# by $Author$ +# +sub VERSION {(q$Revision$ =~ /([\d.]+)\s*$/)[0] or '0.0'} ################################################################################ # @@ -93,9 +96,10 @@ sub read_admin_conf ($) { my %conf; if (-f $filename) { - if (lock_file ($filename)) { - my $xml = new XML::DOM::Parser -> parsefile ($filename); - violent_unlock_file ($filename) unless (unlock_file ($filename)); + my $admin = new Lock ($filename); + if ($admin -> lock(LH_SHARED)) { + my $xml = new XML::DOM::Parser -> parsefile ($admin -> filename); + $admin -> unlock; # write data into the hash # @@ -198,10 +202,6 @@ sub read_admin_conf ($) { -> getFirstChild -> getData }; } - - else { - violent_unlock_file ($filename); - } } # return @@ -213,4 +213,4 @@ sub read_admin_conf ($) { # # -### end of Conf::Admin ######################################################### +### end of Conf::Admin ######################################################### \ No newline at end of file