]> git.stg.codes - stg.git/blobdiff - projects/stargazer/main.cpp
Ticket 26. In the reload() function modSettings vector is defined, a cycle for the
[stg.git] / projects / stargazer / main.cpp
index b8857633a18b9bc4c681fcd10968e6c083162a71..b878b39c41cf5ca146a81ce7712fb3f1e7c4c684 100644 (file)
@@ -221,7 +221,6 @@ if (getuid())
     }
 
 SETTINGS_IMPL settings(argc == 2 ? argv[1] : "");
     }
 
 SETTINGS_IMPL settings(argc == 2 ? argv[1] : "");
-SETTINGS_IMPL newSettings = settings;
 
 if (settings.ReadSettings())
     {
 
 if (settings.ReadSettings())
     {
@@ -339,6 +338,8 @@ while (running)
     switch (sig)
         {
         case SIGHUP:
     switch (sig)
         {
         case SIGHUP:
+            {
+            SETTINGS_IMPL newSettings(settings);
             if (newSettings.ReadSettings())
                 {
                 STG_LOGGER & WriteServLog = GetStgLogger();
             if (newSettings.ReadSettings())
                 {
                 STG_LOGGER & WriteServLog = GetStgLogger();
@@ -349,8 +350,10 @@ while (running)
                 WriteServLog("ReadSettings error. %s", newSettings.GetStrError().c_str());
                 return -1;
                 }
                 WriteServLog("ReadSettings error. %s", newSettings.GetStrError().c_str());
                 return -1;
                 }
+            settings = newSettings;
             traffCnt.Reload();
             traffCnt.Reload();
-            manager.reload();
+            manager.reload(settings);
+            }
             break;
         case SIGTERM:
             running = false;
             break;
         case SIGTERM:
             running = false;