mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-16 23:06:05 +00:00
fhem.pl: avoid crash by putting syswrite in eval (Forum #41790)
git-svn-id: https://svn.fhem.de/fhem/trunk@9420 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
4b0ad010f8
commit
f5709bbc54
11
fhem/fhem.pl
11
fhem/fhem.pl
@ -661,7 +661,16 @@ while (1) {
|
||||
} elsif(defined($hash->{$wbName})) {
|
||||
my $wb = $hash->{$wbName};
|
||||
alarm($hash->{ALARMTIMEOUT}) if($hash->{ALARMTIMEOUT});
|
||||
my $ret = syswrite($hash->{CD}, $wb);
|
||||
|
||||
my $ret;
|
||||
eval { $ret = syswrite($hash->{CD}, $wb); };
|
||||
if($@) {
|
||||
Log 4, "Syswrite: $@, deleting $hash->{NAME}";
|
||||
TcpServer_Close($hash);
|
||||
CommandDelete(undef, $hash->{NAME});
|
||||
next;
|
||||
}
|
||||
|
||||
my $werr = int($!);
|
||||
alarm(0) if($hash->{ALARMTIMEOUT});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user