]> git.stg.codes - stg.git/blobdiff - projects/stargazer/main.cpp
Ticket 26. The 'return -1' removed, 'else' added for the
[stg.git] / projects / stargazer / main.cpp
index b8857633a18b9bc4c681fcd10968e6c083162a71..644fed9145d7a0d43ab27e64d5a9cdd2927bbbd2 100644 (file)
@@ -221,7 +221,6 @@ if (getuid())
     }
 
 SETTINGS_IMPL settings(argc == 2 ? argv[1] : "");
-SETTINGS_IMPL newSettings = settings;
 
 if (settings.ReadSettings())
     {
@@ -339,6 +338,8 @@ while (running)
     switch (sig)
         {
         case SIGHUP:
+            {
+            SETTINGS_IMPL newSettings(settings);
             if (newSettings.ReadSettings())
                 {
                 STG_LOGGER & WriteServLog = GetStgLogger();
@@ -347,10 +348,14 @@ while (running)
                     WriteServLog.SetLogFileName(newSettings.GetLogFileName());
 
                 WriteServLog("ReadSettings error. %s", newSettings.GetStrError().c_str());
-                return -1;
+                }
+            else
+                {
+                settings = newSettings;
                 }
             traffCnt.Reload();
-            manager.reload();
+            manager.reload(settings);
+            }
             break;
         case SIGTERM:
             running = false;
@@ -374,6 +379,8 @@ while (running)
 
 WriteServLog("+++++++++++++++++++++++++++++++++++++++++++++");
 
+manager.stop();
+
 if (loop.Stop())
     WriteServLog("Event loop not stopped.");