2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-13 05:06:35 +00:00

82_LGTV_WebOS: fix crash in filehandle

git-svn-id: https://svn.fhem.de/fhem/trunk@25900 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
LeonGaultier 2022-03-31 04:52:08 +00:00
parent 6f65699a41
commit b638d0b3f1
3 changed files with 37 additions and 3 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- bugfix: 82_LGTV_WebOS: fix crash in filehandle
- bugfix: 89_AndroidDB: Fixed bug in attribute createReadings
- feature: 89_AndroidDB: Added creation of readings for shell commands
- feature: 98_archetype: new option for FILTER in actual_.* attributes

View File

@ -368,7 +368,7 @@ __END__
],
"release_status": "stable",
"license": "GPL_2",
"version": "v3.6.2",
"version": "v3.6.5",
"author": [
"Marko Oldenburg <fhemdevelopment@cooltux.net>"
],

View File

@ -704,7 +704,24 @@ sub Write {
unless ( $hash->{CD} );
::Log3( $name, 4, "LGTV_WebOS ($name) - $string" );
try {
syswrite( $hash->{CD}, $string );
}
catch {
if ( $_->isa('autodie::exception') && $_->matches(':io') ) {
::Log3( $name, 2,
"LGTV_WebOS ($name) - can't write to socket, autodie exception: $_"
);
return;
}
else {
::Log3( $name, 2,
"LGTV_WebOS ($name) - can't write to socket: $_" );
return;
}
};
return;
}
@ -736,7 +753,23 @@ sub Read {
$hash->{helper}->{lastResponse} =
int( ::gettimeofday() ); # Check Socket KeepAlive
try {
$len = sysread( $hash->{CD}, $buf, 10240 );
}
catch {
if ( $_->isa('autodie::exception') && $_->matches(':io') ) {
::Log3( $name, 2,
"LGTV_WebOS ($name) - can't read from socket, autodie exception: $_"
);
return;
}
else {
::Log3( $name, 2,
"LGTV_WebOS ($name) - can't read from socket: $_" );
return;
}
};
if ( !defined($len) || !$len ) {