2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-24 15:19:21 +00:00

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
This commit is contained in:
rudolfkoenig 2014-09-26 17:25:28 +00:00
parent e72398b5e4
commit e4b4f7ec9a

View File

@ -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
}
}