diff options
| author | fukachan <fukachan> | 2002-02-17 13:35:13 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-02-17 13:35:13 +0000 |
| commit | 6a16e0bcb67ca917850d647ee96e4c1e3829ed15 (patch) | |
| tree | 4a8be2621e40d761895aae20d443554742931961 /fml/lib | |
| parent | c00c213953a11aacd1562631869d887bcc48dd71 (diff) | |
| download | fml8-6a16e0bcb67ca917850d647ee96e4c1e3829ed15.tar.gz fml8-6a16e0bcb67ca917850d647ee96e4c1e3829ed15.tar.bz2 fml8-6a16e0bcb67ca917850d647ee96e4c1e3829ed15.zip | |
change use() and new().
not use ErrorStatus.
check $command_args->{ override_need_no_lock } to control lock.
Diffstat (limited to 'fml/lib')
| -rw-r--r-- | fml/lib/FML/Command.pm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fml/lib/FML/Command.pm b/fml/lib/FML/Command.pm index 95bdbc92..a249d672 100644 --- a/fml/lib/FML/Command.pm +++ b/fml/lib/FML/Command.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Command.pm,v 1.18 2002/02/13 10:41:16 fukachan Exp $ +# $FML: Command.pm,v 1.19 2002/02/17 03:13:47 fukachan Exp $ # package FML::Command; @@ -83,9 +83,9 @@ sub AUTOLOAD Log("load $pkg") if $0 =~ /loader/; # debug - eval qq{ require $pkg; $pkg->import();}; + my $command = undef; + eval qq{ use $pkg; \$command = new $pkg;}; unless ($@) { - my $command = $pkg->new(); my $need_lock = 1; # default. if ($command->can('auth')) { @@ -95,14 +95,17 @@ sub AUTOLOAD # this command needs lock (currently giant lock) ? if ($command->can('need_lock')) { $need_lock = $command->need_lock($mode); + + # override lock() + if (defined $command_args->{ override_need_no_lock }) { + $need_lock = 0 if $command_args->{ override_need_no_lock }; + } } if ($command->can('process')) { $curproc->lock() if $need_lock; $command->process($curproc, $command_args); $curproc->unlock() if $need_lock; - - if ($command->error()) { Log($command->error());} } else { LogError("${pkg} has no process method"); |
