From bfd469423b245fd9e6b6bb2c53f68a0b1a83bb2a Mon Sep 17 00:00:00 2001 From: tdressler Date: Sun, 11 May 2008 21:03:13 +0000 Subject: [PATCH] check modules for compiletime errors and deactivated it, if any git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@183 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/fhem.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index a8f4dcec5..39e6457ae 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -140,7 +140,7 @@ my %intAt; # Internal at timer hash. my $intAtCnt=0; my $reread_active = 0; my $AttrList = "room comment"; -my $cvsid = '$Id: fhem.pl,v 1.43 2008-05-11 17:27:01 tdressler Exp $'; +my $cvsid = '$Id: fhem.pl,v 1.44 2008-05-11 21:03:13 tdressler Exp $'; $init_done = 0; @@ -1263,13 +1263,16 @@ CommandReload($$) my $order = $1; Log 5, "Loading $file"; - my $ret; no strict "refs"; # Get the correct module case from the initialize function name. We need # this as sometimes we live on a FAT fs with wrong case eval { - do "$file"; + my $ret=do "$file"; + if (!$ret) { + Log 1,"Error:Modul $param deactivated:\n $@"; + return "$@"; + } foreach my $i (keys %main::) { if($i =~ m/^(${m})_initialize$/i) { $m = $1;