From 259721aa1e8f94c26e372726f54f2dab785755bc Mon Sep 17 00:00:00 2001 From: tetragon Date: Tue, 24 Oct 2006 14:47:05 +0000 Subject: Fix filenames used for memberfile locking git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@288 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/User.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/LedgerSMB/User.pm b/LedgerSMB/User.pm index 09b4a533..0b769a46 100755 --- a/LedgerSMB/User.pm +++ b/LedgerSMB/User.pm @@ -758,12 +758,14 @@ sub save_member { # format dbconnect and dboptions string &dbconnect_vars($self, $self->{dbname}); - $self->error("${LedgerSMB::Sysconfig::memberfile} locked!") if (-f "${memberfile}.LCK"); - open(FH, ">${memberfile}.LCK") or $self->error("${memberfile}.LCK : $!"); + $self->error("${LedgerSMB::Sysconfig::memberfile} locked!") + if (-f "${LedgerSMB::Sysconfig::memberfile}.LCK"); + open(FH, ">${LedgerSMB::Sysconfig::memberfile}.LCK") + or $self->error("${LedgerSMB::Sysconfig::memberfile}.LCK : $!"); close(FH); if (! open(CONF, "+<${LedgerSMB::Sysconfig::memberfile}")) { - unlink "${memberfile}.LCK"; + unlink "${LedgerSMB::Sysconfig::memberfile}.LCK"; $self->error("${LedgerSMB::Sysconfig::memberfile} : $!"); } @@ -816,7 +818,7 @@ sub save_member { print CONF "\n"; close CONF; - unlink "${memberfile}.LCK"; + unlink "${LedgerSMB::Sysconfig::memberfile}.LCK"; # create conf file if (! $self->{'root login'}) { -- cgit v1.2.3