From d27a8e751505bf048e01e8354068aa5a10a9c6da Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Fri, 2 May 2014 18:50:33 +0000 Subject: [PATCH] fhem.pl: slight configDb changes (cfgDB_attrRead) git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@5722 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/fhem.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 5120f1b56..f218c6cfe 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -1932,7 +1932,6 @@ CommandReload($$) $param =~ s,\.pm$,,g; my $file = "$attr{global}{modpath}/FHEM/$param.pm"; my $cfgDB = '-'; - if( ! -r "$file" ) { if(configDBUsed()) { # try to find the file in configDB @@ -3209,13 +3208,15 @@ setGlobalAttrBeforeFork($) { my ($f) = @_; + my ($err, @rows); if($f eq 'configDB') { - cfgDB_GlobalAttr(); - return; + @rows = cfgDB_attrRead('global'); + } else { + ($err, @rows) = FileRead($f); + die("$err\n") if($err); } - open(FH, $f) || die("Cant open $f: $!\n"); - while(my $l = ) { + foreach my $l (@rows) { $l =~ s/[\r\n]//g; next if($l !~ m/^attr\s+global\s+([^\s]+)\s+(.*)$/); my ($n,$v) = ($1,$2); @@ -3224,7 +3225,6 @@ setGlobalAttrBeforeFork($) $attr{global}{$n} = $v; GlobalAttr("set", "global", $n, $v); } - close(FH); }