2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-18 05:56:03 +00:00

fhem.pl: Guard WriteStateFile too (Forum#27412)

git-svn-id: https://svn.fhem.de/fhem/trunk@6623 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2014-09-26 17:55:17 +00:00
parent e4b4f7ec9a
commit fe0b0307fe

View File

@ -1232,8 +1232,7 @@ sub
WriteStatefile()
{
if(configDBUsed()) {
cfgDB_SaveState();
return "";
return cfgDB_SaveState();
}
return "No statefile specified" if(!$attr{global}{statefile});
@ -1288,7 +1287,7 @@ WriteStatefile()
}
}
close(SFH);
return "$attr{global}{statefile}: $!" if(!close(SFH));
return "";
}
@ -1297,11 +1296,12 @@ sub
CommandSave($$)
{
my ($cl, $param) = @_;
my $ret = "";
DoTrigger("global", "SAVE", 1);
WriteStatefile();
my $ret = WriteStatefile();
return $ret if($ret);
$ret = ""; # cfgDB_SaveState may return undef
if(configDBUsed()) {
$ret = cfgDB_SaveCfg();
@ -2565,7 +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
#$SIG{'XFSZ'} = sub { Log 1, "XFSZ signal" }; # to test with limit filesize
}
}