From: Maxim Mamontov Date: Sat, 19 May 2012 17:13:38 +0000 (+0300) Subject: Allow to start mod_rscript without subnets file X-Git-Tag: 2.409~413 X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/db7b9b78524bcdd1f2a5d82c1696bcd2f96d9491?hp=-c Allow to start mod_rscript without subnets file --- db7b9b78524bcdd1f2a5d82c1696bcd2f96d9491 diff --git a/projects/stargazer/plugins/other/rscript/rscript.cpp b/projects/stargazer/plugins/other/rscript/rscript.cpp index 3a557a30..9e560a5d 100644 --- a/projects/stargazer/plugins/other/rscript/rscript.cpp +++ b/projects/stargazer/plugins/other/rscript/rscript.cpp @@ -36,6 +36,7 @@ #include "stg/locker.h" #include "stg/user_property.h" #include "stg/plugin_creator.h" +#include "stg/logger.h" #include "rscript.h" #include "ur_functor.h" #include "send_functor.h" @@ -149,13 +150,14 @@ subnetFile = pvi->value[0]; NRMapParser nrMapParser; -if (nrMapParser.ReadFile(subnetFile)) +if (!nrMapParser.ReadFile(subnetFile)) { - errorStr = nrMapParser.GetErrorStr(); - return -1; + netRouters = nrMapParser.GetMap(); + } +else + { + GetStgLogger()("mod_rscript: error opening subnets file '%s'", subnetFile.c_str()); } - -netRouters = nrMapParser.GetMap(); return 0; }