]> git.stg.codes - stg.git/commitdiff
Ticket 26. SETTING_IMPL newSettings object - copy of the settings object
authorElena Mamontova <helenh463@gmail.com>
Thu, 4 Feb 2016 08:08:37 +0000 (10:08 +0200)
committerElena Mamontova <helenh463@gmail.com>
Thu, 4 Feb 2016 08:08:37 +0000 (10:08 +0200)
added. The newSetings.ReadSettings() call and checking of result added
in the 'switch' after the case SIGHUP.

projects/stargazer/main.cpp

index 73786c4efd6c0cc46ba8aa805b9edaca0d9687cb..b8857633a18b9bc4c681fcd10968e6c083162a71 100644 (file)
@@ -221,6 +221,7 @@ 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())
     {
@@ -338,6 +339,16 @@ while (running)
     switch (sig)
         {
         case SIGHUP:
     switch (sig)
         {
         case SIGHUP:
+            if (newSettings.ReadSettings())
+                {
+                STG_LOGGER & WriteServLog = GetStgLogger();
+
+                if (newSettings.GetLogFileName() != "")
+                    WriteServLog.SetLogFileName(newSettings.GetLogFileName());
+
+                WriteServLog("ReadSettings error. %s", newSettings.GetStrError().c_str());
+                return -1;
+                }
             traffCnt.Reload();
             manager.reload();
             break;
             traffCnt.Reload();
             manager.reload();
             break;