mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
92_FileLog.pm: better switch for readonly files
git-svn-id: https://svn.fhem.de/fhem/trunk@10007 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2575689ea3
commit
b036d2f6ff
@ -147,6 +147,8 @@ FileLog_Switch($)
|
||||
my $cn = ResolveDateWildcards($log->{logfile}, @t);
|
||||
|
||||
if($cn ne $log->{currentlogfile}) { # New logfile
|
||||
$log->{currentlogfile} = $cn;
|
||||
return 1 if($log->{READONLY});
|
||||
$fh->close() if($fh);
|
||||
HandleArchiving($log);
|
||||
$fh = new IO::File ">>$cn";
|
||||
@ -154,7 +156,6 @@ FileLog_Switch($)
|
||||
Log3 $log, 0, "Can't open $cn";
|
||||
return 0;
|
||||
}
|
||||
$log->{currentlogfile} = $cn;
|
||||
$log->{FH} = $fh;
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user