mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-14 15:39:12 +00:00
rereadcfg reports uninitialized when 99*.pm is buggy
git-svn-id: https://svn.fhem.de/fhem/trunk@1604 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
48b43f7c9e
commit
95e45d492a
@ -81,7 +81,7 @@ sub fhem($);
|
||||
sub fhz($);
|
||||
sub IsDummy($);
|
||||
sub IsIgnored($);
|
||||
sub setGlobalAttrBeforeFork();
|
||||
sub setGlobalAttrBeforeFork($);
|
||||
sub redirectStdinStdErr();
|
||||
sub setReadingsVal($$$$);
|
||||
sub addEvent($$);
|
||||
@ -310,7 +310,7 @@ doGlobalDef($ARGV[0]);
|
||||
# As newer Linux versions reset serial parameters after fork, we parse the
|
||||
# config file after the fork. Since need some global attr parameters before, we
|
||||
# read them here.
|
||||
setGlobalAttrBeforeFork();
|
||||
setGlobalAttrBeforeFork($attr{global}{configfile});
|
||||
|
||||
if($^O =~ m/Win/ && !$attr{global}{nofork}) {
|
||||
Log 1, "Forcing 'attr global nofork' on WINDOWS";
|
||||
@ -970,6 +970,7 @@ CommandRereadCfg($$)
|
||||
%readyfnlist = ();
|
||||
|
||||
doGlobalDef($cfgfile);
|
||||
setGlobalAttrBeforeFork($cfgfile);
|
||||
|
||||
my $ret = CommandInclude($cl, $cfgfile);
|
||||
if($attr{global}{statefile} && -r $attr{global}{statefile}) {
|
||||
@ -2647,9 +2648,9 @@ ReplaceEventMap($$$)
|
||||
}
|
||||
|
||||
sub
|
||||
setGlobalAttrBeforeFork()
|
||||
setGlobalAttrBeforeFork($)
|
||||
{
|
||||
my $f = $attr{global}{configfile};
|
||||
my ($f) = @_;
|
||||
open(FH, $f) || die("Cant open $f: $!\n");
|
||||
while(my $l = <FH>) {
|
||||
$l =~ s/[\r\n]//g;
|
||||
|
Loading…
x
Reference in New Issue
Block a user