]> git.stg.codes - stg.git/commitdiff
Ticket 26. The SETTINGS_IMPL newSettings object declaration moved into
authorElena Mamontova <helenh463@gmail.com>
Tue, 9 Feb 2016 15:57:06 +0000 (17:57 +0200)
committerElena Mamontova <helenh463@gmail.com>
Tue, 9 Feb 2016 15:57:06 +0000 (17:57 +0200)
case SIGHUP. The settings = newSettings added to case SIGHUP.

projects/stargazer/main.cpp

index b8857633a18b9bc4c681fcd10968e6c083162a71..860800f80987e7b4e10c655496957edab11cfd56 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();
             manager.reload();
             traffCnt.Reload();
             manager.reload();
+            }
             break;
         case SIGTERM:
             running = false;
             break;
         case SIGTERM:
             running = false;