mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +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 $max = int(@{$dev->{CHANGED}});
|
||||||
my $tn = $dev->{NTFY_TRIGGERTIME};
|
my $tn = $dev->{NTFY_TRIGGERTIME};
|
||||||
my $ct = $dev->{CHANGETIME};
|
my $ct = $dev->{CHANGETIME};
|
||||||
my $wrotesome;
|
my $fh;
|
||||||
my $fh = $log->{FH};
|
|
||||||
my $switched;
|
my $switched;
|
||||||
|
|
||||||
for (my $i = 0; $i < $max; $i++) {
|
for (my $i = 0; $i < $max; $i++) {
|
||||||
@ -132,12 +131,11 @@ FileLog_Log($$)
|
|||||||
FileLog_Switch($log);
|
FileLog_Switch($log);
|
||||||
$switched = 1;
|
$switched = 1;
|
||||||
}
|
}
|
||||||
|
$fh = $log->{FH};
|
||||||
print $fh "$t $n $s\n";
|
print $fh "$t $n $s\n";
|
||||||
$wrotesome = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($wrotesome) {
|
if($fh) {
|
||||||
$fh->flush;
|
$fh->flush;
|
||||||
# Skip sync, it costs too much HD strain, esp. on SSD
|
# Skip sync, it costs too much HD strain, esp. on SSD
|
||||||
# $fh->sync if !($^O eq 'MSWin32'); #not implemented in Windows
|
# $fh->sync if !($^O eq 'MSWin32'); #not implemented in Windows
|
||||||
|
Loading…
x
Reference in New Issue
Block a user