From b5e9f6a8ff1d6ffcaaf663a993de62d8138a3025 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 30 Oct 2021 12:58:16 +0000 Subject: [PATCH] fhem.pl: add optional parameter to WriteStatefile (Forum #123764) git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@25156 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fhem.pl b/fhem.pl index 92c350285..c3883b99a 100755 --- a/fhem.pl +++ b/fhem.pl @@ -101,7 +101,7 @@ sub SemicolonEscape($); sub SignalHandling(); sub TimeNow(); sub Value($); -sub WriteStatefile(); +sub WriteStatefile(;$); sub XmlEscape($); sub addEvent($$;$); sub addToDevAttrList($$;$); @@ -1593,13 +1593,14 @@ GetAllReadings($) ##################################### sub -WriteStatefile() +WriteStatefile(;$) { if(configDBUsed()) { return cfgDB_SaveState(); } my $stateFile = AttrVal('global','statefile',undef); + $stateFile = $_[0] if($_[0]); #123764 return "No statefile specified" if(!defined($stateFile)); my $now = gettimeofday();