mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-01 07:19:24 +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:
parent
aab2d16cc2
commit
a75c03970e
@ -106,7 +106,10 @@ BlockingInformParent($;$$)
|
|||||||
if(!$telnetClient) {
|
if(!$telnetClient) {
|
||||||
my $addr = "localhost:$defs{$telnetDevice}{PORT}";
|
my $addr = "localhost:$defs{$telnetDevice}{PORT}";
|
||||||
$telnetClient = IO::Socket::INET->new(PeerAddr => $addr);
|
$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)) {
|
if(defined($param)) {
|
||||||
@ -138,6 +141,11 @@ sub
|
|||||||
BlockingKill($)
|
BlockingKill($)
|
||||||
{
|
{
|
||||||
my $h = shift;
|
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($^O !~ m/Win/) {
|
||||||
if($h->{pid} && kill(9, $h->{pid})) {
|
if($h->{pid} && kill(9, $h->{pid})) {
|
||||||
Log 1, "Timeout for $h->{fn} reached, terminated process $h->{pid}";
|
Log 1, "Timeout for $h->{fn} reached, terminated process $h->{pid}";
|
||||||
|
Loading…
Reference in New Issue
Block a user