2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

70_SISPM: Patch by inf0 (Forum #123163)

git-svn-id: https://svn.fhem.de/fhem/trunk@25037 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2021-10-01 08:14:27 +00:00
parent 2c420143c6
commit 3ec26e59b3

View File

@ -224,8 +224,9 @@ SISPM_Undef($$)
my @a = split("[ \t][ \t]*", $def); my @a = split("[ \t][ \t]*", $def);
my $name = $hash->{NAME}; my $name = $hash->{NAME};
if(defined($hash->{FD})) { if(defined($hash->{FH})) {
close($hash->{FD}); close($hash->{FH});
delete $hash->{FH};
delete $hash->{FD}; delete $hash->{FD};
} }
delete $selectlist{"$name.pipe"}; delete $selectlist{"$name.pipe"};
@ -263,7 +264,8 @@ SISPM_GetStatus($)
return "SISPM Can't open pipe: $dev: $!"; return "SISPM Can't open pipe: $dev: $!";
} }
$hash->{FD}=$FH; $hash->{FD}=fileno($FH);
$hash->{FH}=$FH;
$selectlist{"$name.pipe"} = $hash; $selectlist{"$name.pipe"} = $hash;
Log 4, "SISPM pipe opened"; Log 4, "SISPM pipe opened";
$hash->{STATE} = "running"; $hash->{STATE} = "running";
@ -293,7 +295,7 @@ SISPM_Read($)
Log 3, "Oops, SISPM FD empty"; Log 3, "Oops, SISPM FD empty";
return undef; return undef;
} }
$FH = $hash->{FD}; $FH = $hash->{FH};
Log 4, "SISPM reading started"; Log 4, "SISPM reading started";