mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 04:36:36 +00:00
Fixing bug on logfile-switch
git-svn-id: https://svn.fhem.de/fhem/trunk@3266 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7167738d55
commit
936b36aaf2
@ -117,8 +117,7 @@ FileLog_Log($$)
|
||||
my $max = int(@{$dev->{CHANGED}});
|
||||
my $tn = $dev->{NTFY_TRIGGERTIME};
|
||||
my $ct = $dev->{CHANGETIME};
|
||||
my $wrotesome;
|
||||
my $fh = $log->{FH};
|
||||
my $fh;
|
||||
my $switched;
|
||||
|
||||
for (my $i = 0; $i < $max; $i++) {
|
||||
@ -132,12 +131,11 @@ FileLog_Log($$)
|
||||
FileLog_Switch($log);
|
||||
$switched = 1;
|
||||
}
|
||||
|
||||
$fh = $log->{FH};
|
||||
print $fh "$t $n $s\n";
|
||||
$wrotesome = 1;
|
||||
}
|
||||
}
|
||||
if($wrotesome) {
|
||||
if($fh) {
|
||||
$fh->flush;
|
||||
# Skip sync, it costs too much HD strain, esp. on SSD
|
||||
# $fh->sync if !($^O eq 'MSWin32'); #not implemented in Windows
|
||||
|
Loading…
x
Reference in New Issue
Block a user