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:
parent
e4b4f7ec9a
commit
fe0b0307fe
12
fhem/fhem.pl
12
fhem/fhem.pl
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user