]> git.stg.codes - stg.git/blobdiff - projects/stargazer/main.cpp
Removed artefact from previous patch.
[stg.git] / projects / stargazer / main.cpp
index a8678893c4d7935e1c84e66aa3240812e1e700d9..cabd991be6361e3f08695173b9387f4d903acaaa 100644 (file)
@@ -99,7 +99,11 @@ else
     }
 }
 //-----------------------------------------------------------------------------
+#ifdef LINUX
 int StartScriptExecuter(char * procName, int msgKey, int * msgID, SETTINGS_IMPL * settings)
+#else
+int StartScriptExecuter(char *, int msgKey, int * msgID, SETTINGS_IMPL * settings)
+#endif
 {
 STG_LOGGER & WriteServLog = GetStgLogger();
 
@@ -140,12 +144,20 @@ switch (executerPid)
 
     case 0:
         delete settings;
+#ifdef LINUX
         Executer(*msgID, executerPid, procName);
+#else
+        Executer(*msgID, executerPid);
+#endif
         return 1;
 
     default:
         if (executersPid.empty()) {
+#ifdef LINUX
             Executer(*msgID, executerPid, NULL);
+#else
+            Executer(*msgID, executerPid);
+#endif
         }
         executersPid.insert(executerPid);
     }
@@ -351,7 +363,8 @@ while (modIter != modules.end())
     {
     if (modIter->Load())
         {
-        WriteServLog("Error: %s",
+        WriteServLog("Error loading module '%s': %s",
+                     modIter->GetPlugin()->GetVersion().c_str(),
                      modIter->GetStrError().c_str());
         goto exitLblNotStarted;
         }
@@ -378,7 +391,8 @@ while (modIter != modules.end())
     {
     if (modIter->Start())
         {
-        WriteServLog("Error: %s",
+        WriteServLog("Error starting module '%s': %s",
+                     modIter->GetPlugin()->GetVersion().c_str(),
                      modIter->GetStrError().c_str());
         goto exitLbl;
         }
@@ -413,9 +427,9 @@ while (true)
                 {
                 if (modIter->Reload())
                     {
-                    WriteServLog("Error reloading %s ('%s')", modIter->GetPlugin()->GetVersion().c_str(),
+                    WriteServLog("Error reloading module '%s': '%s'", modIter->GetPlugin()->GetVersion().c_str(),
                                                               modIter->GetStrError().c_str());
-                    printfd(__FILE__, "Error reloading %s ('%s')\n", modIter->GetPlugin()->GetVersion().c_str(),
+                    printfd(__FILE__, "Error reloading module '%s': '%s'\n", modIter->GetPlugin()->GetVersion().c_str(),
                                                                      modIter->GetStrError().c_str());
                     }
                 }
@@ -461,12 +475,15 @@ while (modIter != modules.end())
     printfd(__FILE__, "Stopping module '%s'\n", name.c_str());
     if (modIter->Stop())
         {
-        WriteServLog("Module \'%s\': Error: %s",
+        WriteServLog("Error stopping module '%s': %s",
                      modIter->GetPlugin()->GetVersion().c_str(),
                      modIter->GetStrError().c_str());
-        printfd(__FILE__, "Failed to stop module '%s'\n", name.c_str());
+        printfd(__FILE__, "Error stopping module '%s': '%s'\n", modIter->GetPlugin()->GetVersion().c_str(), modIter->GetStrError().c_str());
+        }
+    else
+        {
+        WriteServLog("Module: '%s'. Stop successfull.", modIter->GetPlugin()->GetVersion().c_str());
         }
-    WriteServLog("Module: \'%s\'. Stop successfull.", modIter->GetPlugin()->GetVersion().c_str());
     ++modIter;
     }
 
@@ -490,10 +507,10 @@ while (modIter != modules.end())
         printfd(__FILE__, "Unloading module '%s'\n", name.c_str());
         if (modIter->Unload())
             {
-            WriteServLog("Module \'%s\': Error: %s",
-                         name.c_str(),
+            WriteServLog("Error unloading module '%s': '%s'",
+                         modIter->GetPlugin()->GetVersion().c_str(),
                          modIter->GetStrError().c_str());
-            printfd(__FILE__, "Failed to unload module '%s'\n", name.c_str());
+            printfd(__FILE__, "Error unloading module '%s': '%s'\n", modIter->GetPlugin()->GetVersion().c_str(), modIter->GetStrError().c_str());
             }
         }
     ++modIter;