2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

fhem.pl: allow sleep 0, fix InternalTimer bug

git-svn-id: https://svn.fhem.de/fhem/trunk@13593 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-03-04 07:53:44 +00:00
parent 8d795e5de3
commit f6c8660223

View File

@ -2852,7 +2852,7 @@ CommandSleep($$)
Log 4, "sleeping for $sec"; Log 4, "sleeping for $sec";
if(@cmdList && $sec && $init_done) { if(@cmdList && $init_done) {
my %h = (cmd => join(";", @cmdList), my %h = (cmd => join(";", @cmdList),
evalSpecials => $evalSpecials, evalSpecials => $evalSpecials,
quiet => $quiet, quiet => $quiet,
@ -2928,6 +2928,7 @@ InternalTimer($$$;$)
{ {
my ($tim, $fn, $arg, $waitIfInitNotDone) = @_; my ($tim, $fn, $arg, $waitIfInitNotDone) = @_;
$tim = 1 if(!$tim);
if(!$init_done && $waitIfInitNotDone) { if(!$init_done && $waitIfInitNotDone) {
select(undef, undef, undef, $tim-gettimeofday()); select(undef, undef, undef, $tim-gettimeofday());
no strict "refs"; no strict "refs";