2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

Blocking.pm: fix some windows problems (Forum #79222)

git-svn-id: https://svn.fhem.de/fhem/trunk@15412 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-11-09 14:34:29 +00:00
parent 42c438ddaf
commit 8d20208431

View File

@ -187,7 +187,7 @@ BlockingStart(;$)
# Child here # Child here
BlockingInformParent("BlockingRegisterTelnet", "\$cl,$h->{bc_pid}", 1, 1) BlockingInformParent("BlockingRegisterTelnet", "\$cl,$h->{bc_pid}", 1, 1)
if($h->{abortFn}); if($h->{abortFn} && $^O !~ m/Win/);
no strict "refs"; no strict "refs";
my $ret = &{$h->{fn}}($h->{arg}); my $ret = &{$h->{fn}}($h->{arg});
use strict "refs"; use strict "refs";
@ -272,7 +272,7 @@ BlockingKill($)
return if($h->{terminated}); return if($h->{terminated});
if($^O !~ m/Win/) { # if($^O !~ m/Win/) {
if($h->{pid} && $h->{pid} !~ m/:/ && kill(9, $h->{pid})) { if($h->{pid} && $h->{pid} !~ m/:/ && kill(9, $h->{pid})) {
my $ll = (defined($h->{loglevel}) ? $h->{loglevel} : 1); # Forum #77057 my $ll = (defined($h->{loglevel}) ? $h->{loglevel} : 1); # Forum #77057
Log $ll, "Timeout for $h->{fn} reached, terminated process $h->{pid}"; Log $ll, "Timeout for $h->{fn} reached, terminated process $h->{pid}";
@ -289,10 +289,11 @@ BlockingKill($)
use strict "refs"; use strict "refs";
} }
delete($BC_hash{$h->{bc_pid}});
InternalTimer(gettimeofday()+1, "BlockingStart", \%BC_hash, 0) InternalTimer(gettimeofday()+1, "BlockingStart", \%BC_hash, 0)
if(looks_like_number($h->{pid}) && kill(0, $h->{pid})); # Forum #58867 if(looks_like_number($h->{pid}) && kill(0, $h->{pid})); # Forum #58867
} }
} # }
BlockingStart(); BlockingStart();
} }