From e4b4f7ec9a3dbb7d46c42d0833bbe984ba2b8b97 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Fri, 26 Sep 2014 17:25:28 +0000 Subject: [PATCH] fhem.pl: check for write errors in save (Forum #27412) git-svn-id: https://svn.fhem.de/fhem/trunk@6622 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/fhem.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 3c31852d5..000465036 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -1373,8 +1373,9 @@ CommandSave($$) print SFH "include $attr{global}{lastinclude}\n" if($attr{global}{lastinclude}); - foreach my $fh (values %fh) { - close($fh) if($fh ne "1"); + foreach my $key (keys %fh) { + next if($fh{$key} eq "1"); ## R/O include files + $ret .= "$key: $!" if(!close($fh{$key})); } return ($ret ? $ret : "Wrote configuration to $param"); } @@ -2564,6 +2565,7 @@ SignalHandling() $SIG{'CHLD'} = 'IGNORE'; $SIG{'HUP'} = sub { CommandRereadCfg(undef, "") }; $SIG{'ALRM'} = sub { Log 1, "ALARM signal, blocking write?" }; + #$SIG{'XFSZ'} = sub { Log 1, "XFSZ signal" }; to test with limit filesize } }