From 3ec26e59b3c5e691acd6db9dc8e22628909616c1 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Fri, 1 Oct 2021 08:14:27 +0000 Subject: [PATCH] 70_SISPM: Patch by inf0 (Forum #123163) git-svn-id: https://svn.fhem.de/fhem/trunk@25037 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/70_SISPM.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/70_SISPM.pm b/fhem/FHEM/70_SISPM.pm index 1d41d9c19..8bc975165 100644 --- a/fhem/FHEM/70_SISPM.pm +++ b/fhem/FHEM/70_SISPM.pm @@ -224,8 +224,9 @@ SISPM_Undef($$) my @a = split("[ \t][ \t]*", $def); my $name = $hash->{NAME}; - if(defined($hash->{FD})) { - close($hash->{FD}); + if(defined($hash->{FH})) { + close($hash->{FH}); + delete $hash->{FH}; delete $hash->{FD}; } delete $selectlist{"$name.pipe"}; @@ -263,7 +264,8 @@ SISPM_GetStatus($) return "SISPM Can't open pipe: $dev: $!"; } - $hash->{FD}=$FH; + $hash->{FD}=fileno($FH); + $hash->{FH}=$FH; $selectlist{"$name.pipe"} = $hash; Log 4, "SISPM pipe opened"; $hash->{STATE} = "running"; @@ -293,7 +295,7 @@ SISPM_Read($) Log 3, "Oops, SISPM FD empty"; return undef; } - $FH = $hash->{FD}; + $FH = $hash->{FH}; Log 4, "SISPM reading started"; @@ -434,7 +436,7 @@ SISPM_Read($) if($eof) { close($FH); - delete $hash->{FH}; + delete $hash->{FH}; delete $hash->{FD}; delete $selectlist{"$name.pipe"}; InternalTimer(gettimeofday()+ $hash->{Timer}, "SISPM_GetStatus", $hash, 1);