2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-01 01:09:47 +00:00

Blocking.pm: some more Win support (Forum #40350)

git-svn-id: https://svn.fhem.de/fhem/trunk@9131 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-08-25 19:55:07 +00:00
parent aab2d16cc2
commit a75c03970e

View File

@ -106,7 +106,10 @@ BlockingInformParent($;$$)
if(!$telnetClient) {
my $addr = "localhost:$defs{$telnetDevice}{PORT}";
$telnetClient = IO::Socket::INET->new(PeerAddr => $addr);
Log 1, "CallBlockingFn: Can't connect to $addr: $@" if(!$telnetClient);
if(!$telnetClient) {
Log 1, "CallBlockingFn: Can't connect to $addr: $@";
return;
}
}
if(defined($param)) {
@ -138,6 +141,11 @@ sub
BlockingKill($)
{
my $h = shift;
# MaxNr of concurrent forked processes @Win is 64, and must use wait as
# $SIG{CHLD} = 'IGNORE' does not work.
wait if($^O =~ m/Win/);
if($^O !~ m/Win/) {
if($h->{pid} && kill(9, $h->{pid})) {
Log 1, "Timeout for $h->{fn} reached, terminated process $h->{pid}";