From: Maxim Mamontov <faust@gts.dp.ua>
Date: Wed, 26 Jan 2011 15:52:49 +0000 (+0200)
Subject: Додано пропущені заголовочні файли
X-Git-Tag: 2.407-rc3~198
X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/78e14695fc1b743f225a5aa30ca98784bce576c1

Додано пропущені заголовочні файли
---

diff --git a/projects/stargazer/main.cpp b/projects/stargazer/main.cpp
index 7a225ce5..2d5b808f 100644
--- a/projects/stargazer/main.cpp
+++ b/projects/stargazer/main.cpp
@@ -24,7 +24,7 @@
  $Author: faust $
  */
 
-#include <stdio.h>
+//#include <stdio.h>
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -35,9 +35,10 @@
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <dlfcn.h>
-#include <signal.h>
 #include <fcntl.h>
 
+#include <csignal>
+#include <cerrno>
 #include <fstream>
 #include <vector>
 #include <set>
@@ -493,7 +494,6 @@ if (settings->ReadSettings())
 string startFile(settings->GetConfDir() + START_FILE);
 #endif
 
-//SetSignalHandlers();
 if (ForkAndWait(settings->GetConfDir()) < 0)
     {
     STG_LOGGER & WriteServLog = GetStgLogger();
@@ -505,14 +505,13 @@ STG_LOGGER & WriteServLog = GetStgLogger();
 WriteServLog.SetLogFileName(settings->GetLogFileName());
 WriteServLog("Stg v. %s", SERVER_VERSION);
 
-for (int i = 0; i < settings->GetExecutersNum(); i++)
+for (size_t i = 0; i < settings->GetExecutersNum(); i++)
     {
     int ret = StartScriptExecuter(argv[0], settings->GetExecMsgKey(), &msgID, settings);
     if (ret < 0)
         {
         STG_LOGGER & WriteServLog = GetStgLogger();
         WriteServLog("Start Script Executer error!");
-        //goto exitLbl;
         return 1;
         }
     if (ret == 1)
@@ -555,7 +554,6 @@ admins = new ADMINS(dataStore);
 users = new USERS(settings, dataStore, tariffs, admins->GetSysAdmin());
 traffCnt = new TRAFFCOUNTER(users, tariffs, settings->GetRulesFileName());
 traffCnt->SetMonitorDir(settings->GetMonitorDir());
-//tariffs->SetUsers(users);
 
 modSettings = settings->GetModulesSettings();
 
@@ -647,8 +645,6 @@ WriteServLog("+++++++++++++++++++++++++++++++++++++++++++++");
 creat(startFile.c_str(), S_IRUSR);
 #endif
 
-//*a_kill_it = 0;
-
 while (nonstop.GetStatus())
     {
     if (needRulesReloading)
@@ -702,7 +698,7 @@ if (loop.Stop())
 
 exitLblNotStarted:
 
-/*modIter = modules.begin();
+modIter = modules.begin();
 while (modIter != modules.end())
     {
     std::string name = modIter->GetFileName();
@@ -715,7 +711,7 @@ while (modIter != modules.end())
         printfd(__FILE__, "Failed to unload module '%s'\n", name.c_str());
         }
     ++modIter;
-    }*/
+    }
 
 if (traffCnt)
     {
diff --git a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
index 6d8db063..47ff002d 100644
--- a/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
+++ b/projects/stargazer/plugins/authorization/inetaccess/inetaccess.cpp
@@ -30,8 +30,11 @@
 
 #include <sys/types.h>
 #include <sys/socket.h>
+
 #include <csignal>
 #include <cstdlib>
+#include <cstdio> // snprintf
+#include <cerrno>
 #include <algorithm>
 
 #include "inetaccess.h"
diff --git a/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp b/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp
index 72fb399e..fd9f86be 100644
--- a/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp
+++ b/projects/stargazer/plugins/configuration/rpcconfig/users_methods.cpp
@@ -1,3 +1,5 @@
+#include <cerrno>
+
 #include "users_methods.h"
 
 #include "../../../users.h"
diff --git a/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp b/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp
index aeb1c783..e3b26520 100644
--- a/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp
+++ b/projects/stargazer/plugins/configuration/sgconfig/parser_tariff.cpp
@@ -1,4 +1,4 @@
-//#include <stdio.h>
+#include <cstdio> // snprintf
 #include <cstring>
 
 #include "parser.h"
diff --git a/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp b/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp
index 8d2ce153..a3957f36 100644
--- a/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp
+++ b/projects/stargazer/plugins/configuration/sgconfig/rsconf.cpp
@@ -28,6 +28,7 @@
 
 #include <cerrno>
 #include <csignal>
+#include <cstdio> // snprintf
 
 #include "configproto.h"
 #include "blowfish.h"
@@ -545,7 +546,7 @@ void CONFIGPROTO::SendError(const char * text)
 {
 char s[255];
 answerList.clear();
-sprintf(s, "<Error value=\"%s\"/>", text);
+snprintf(s, 255, "<Error value=\"%s\"/>", text);
 answerList.push_back(s);
 }
 //-----------------------------------------------------------------------------
diff --git a/projects/stargazer/plugins/other/radius/radius.cpp b/projects/stargazer/plugins/other/radius/radius.cpp
index 9b8c67d1..9c5ab1db 100644
--- a/projects/stargazer/plugins/other/radius/radius.cpp
+++ b/projects/stargazer/plugins/other/radius/radius.cpp
@@ -27,6 +27,7 @@
  */
 
 #include <csignal>
+#include <cerrno>
 #include <algorithm>
 
 #include "radius.h"
diff --git a/projects/stargazer/traffcounter.cpp b/projects/stargazer/traffcounter.cpp
index e9c143ec..1d088f48 100644
--- a/projects/stargazer/traffcounter.cpp
+++ b/projects/stargazer/traffcounter.cpp
@@ -30,6 +30,7 @@
 
 #include <csignal>
 #include <cassert>
+#include <cstdio> // Functions fopen and similar
 
 #include "traffcounter.h"
 #include "common.h"