2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 17:26:34 +00:00

Watchdog crash fixed

git-svn-id: https://svn.fhem.de/fhem/trunk@267 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2008-11-15 09:28:22 +00:00
parent 6f5d628c45
commit b7d3b1d525
2 changed files with 11 additions and 8 deletions

View File

@ -101,6 +101,7 @@ watchdog_Activate($)
my ($ntfy) = @_; my ($ntfy) = @_;
my $nt = gettimeofday() + $ntfy->{TO}; my $nt = gettimeofday() + $ntfy->{TO};
$ntfy->{STATE} = "Next: " . FmtTime($nt); $ntfy->{STATE} = "Next: " . FmtTime($nt);
RemoveInternalTimer($ntfy);
InternalTimer($nt, "watchdog_Trigger", $ntfy, 0) InternalTimer($nt, "watchdog_Trigger", $ntfy, 0)
} }

View File

@ -145,7 +145,7 @@ my $nextat; # Time when next timer will be triggered.
my $intAtCnt=0; my $intAtCnt=0;
my $reread_active = 0; my $reread_active = 0;
my $AttrList = "room comment"; my $AttrList = "room comment";
my $cvsid = '$Id: fhem.pl,v 1.56 2008-11-01 21:27:10 neubert Exp $'; my $cvsid = '$Id: fhem.pl,v 1.57 2008-11-15 09:28:22 rudolfkoenig Exp $';
my $namedef = my $namedef =
"where <name> is either:\n" . "where <name> is either:\n" .
"- a single device name\n" . "- a single device name\n" .
@ -1632,9 +1632,13 @@ HandleTimeout()
# Check the internal list. # Check the internal list.
foreach my $i (keys %intAt) { foreach my $i (keys %intAt) {
my $tim = $intAt{$i}{TRIGGERTIME}; my $tim = $intAt{$i}{TRIGGERTIME};
if($tim <= $now) { my $fn = $intAt{$i}{FN};
if(!defined($tim) || !defined($fn)) {
delete($intAt{$i});
next;
} elsif($tim <= $now) {
no strict "refs"; no strict "refs";
&{$intAt{$i}{FN}}($intAt{$i}{ARG}); &{$fn}($intAt{$i}{ARG});
use strict "refs"; use strict "refs";
delete($intAt{$i}); delete($intAt{$i});
} }
@ -1856,11 +1860,9 @@ DoTrigger($$)
my $ret = ""; my $ret = "";
foreach my $n (sort keys %defs) { foreach my $n (sort keys %defs) {
if(defined($modules{$defs{$n}{TYPE}})) { if(defined($modules{$defs{$n}{TYPE}})) {
if(defined($modules{$defs{$n}{TYPE}}{NotifyFn})) { if($modules{$defs{$n}{TYPE}}{NotifyFn}) {
if($modules{$defs{$n}{TYPE}}{NotifyFn}) { Log 5, "$dev trigger: Checking $n for notify";
Log 5, "$dev trigger: Checking $n for notify"; $ret .= CallFn($n, "NotifyFn", $defs{$n}, $defs{$dev});
$ret .= CallFn($n, "NotifyFn", $defs{$n}, $defs{$dev});
}
} }
} }
} }