]> 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 73786c4efd6c0cc46ba8aa805b9edaca0d9687cb..644fed9145d7a0d43ab27e64d5a9cdd2927bbbd2 100644 (file)
@@ -338,8 +338,24 @@ while (running)
     switch (sig)
         {
         case SIGHUP:
+            {
+            SETTINGS_IMPL newSettings(settings);
+            if (newSettings.ReadSettings())
+                {
+                STG_LOGGER & WriteServLog = GetStgLogger();
+
+                if (newSettings.GetLogFileName() != "")
+                    WriteServLog.SetLogFileName(newSettings.GetLogFileName());
+
+                WriteServLog("ReadSettings error. %s", newSettings.GetStrError().c_str());
+                }
+            else
+                {
+                settings = newSettings;
+                }
             traffCnt.Reload();
-            manager.reload();
+            manager.reload(settings);
+            }
             break;
         case SIGTERM:
             running = false;
@@ -363,6 +379,8 @@ while (running)
 
 WriteServLog("+++++++++++++++++++++++++++++++++++++++++++++");
 
+manager.stop();
+
 if (loop.Stop())
     WriteServLog("Event loop not stopped.");