mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +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:
parent
2c420143c6
commit
3ec26e59b3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user