]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd_io.cpp
(Untested) added hashcomp.cpp, seperates out the stl hash_map stuff
[user/henk/code/inspircd.git] / src / inspircd_io.cpp
index 79e91217574b0f843fb97154443e3417273b429e..fcbb83aaeb18a57cbc495f68cfda81a436b5f471 100644 (file)
@@ -26,6 +26,7 @@
 #include "inspircd_io.h"
 #include "inspircd_util.h"
 #include "inspstring.h"
+#include "helperfuncs.h"
 
 using namespace std;
 
@@ -63,12 +64,12 @@ void Rehash(int status)
 
 void Start (void)
 {
-       printf("\033[1mInspire Internet Relay Chat Server, compiled " __DATE__ " at " __TIME__ "\n");
-       printf("(C) ChatSpike Development team.\033[0;37m\n\n");
-       printf("Developers:\033[1m     Brain, FrostyCoolSlug\n");
-       printf("Documentation:\033[1m  FrostyCoolSlug, w00t\n");
-       printf("Testers:\033[1m        typobox43, piggles, Lord_Zathras, CC\n");
-       printf("Name concept:\033[1m   Lord_Zathras\n\n");
+       printf("\033[1;32mInspire Internet Relay Chat Server, compiled %s at %s\n",__DATE__,__TIME__);
+       printf("(C) ChatSpike Development team.\033[0m\n\n");
+       printf("Developers:\033[1;32m     Brain, FrostyCoolSlug\033[0m\n");
+       printf("Documentation:\033[1;32m  FrostyCoolSlug, w00t\033[0m\n");
+       printf("Testers:\033[1;32m        typobox43, piggles, Lord_Zathras, CC\033[0m\n");
+       printf("Name concept:\033[1;32m   Lord_Zathras\033[0m\n\n");
 }
 
 void WritePID(std::string filename)
@@ -87,34 +88,26 @@ void WritePID(std::string filename)
        }
 }
 
-void DeadPipe(int status)
-{
-  signal (SIGPIPE, DeadPipe);
-}
 
 int DaemonSeed (void)
 {
        int childpid;
        signal (SIGALRM, SIG_IGN);
        signal (SIGHUP, Rehash);
-       signal (SIGPIPE, DeadPipe);
+       signal (SIGPIPE, SIG_IGN);
        signal (SIGTERM, Exit);
-       signal (SIGABRT, Exit);
        signal (SIGSEGV, Error);
-       signal (SIGURG, Exit);
-       signal (SIGKILL, Exit);
        if ((childpid = fork ()) < 0)
                return (ERROR);
        else if (childpid > 0)
                exit (0);
        setsid ();
        umask (007);
-       printf("InspIRCd PID: %d\n",getpid());
-       /* close stdin, stdout, stderr */
+       printf("InspIRCd Process ID: \033[1;32m%lu\033[0m\n",(unsigned long)getpid());
        freopen("/dev/null","w",stdout);
        freopen("/dev/null","w",stderr);
        
-       setpriority(PRIO_PROCESS,(int)getpid(),15); /* ircd sets to low process priority so it doesnt hog the box */
+       setpriority(PRIO_PROCESS,(int)getpid(),15);
 
        if (unlimitcore)
        {
@@ -340,8 +333,7 @@ int EnumConf(std::stringstream *config, const char* tag)
 {
        int ptr = 0;
        char buffer[MAXBUF], c_tag[MAXBUF], c, lastc;
-       int in_token, in_quotes, tptr, j, idx = 0;
-       char* key;
+       int in_token, in_quotes, tptr, idx = 0;
 
        const char* buf = config->str().c_str();
        long bptr = 0;
@@ -411,8 +403,7 @@ int EnumValues(std::stringstream *config, const char* tag, int index)
 {
        int ptr = 0;
        char buffer[MAXBUF], c_tag[MAXBUF], c, lastc;
-       int in_token, in_quotes, tptr, j, idx = 0;
-       char* key;
+       int in_token, in_quotes, tptr, idx = 0;
        
        bool correct_tag = false;
        int num_items = 0;
@@ -515,7 +506,7 @@ int ReadConf(std::stringstream *config, const char* tag, const char* var, int in
 
        const char* buf = config->str().c_str();
        long bptr = 0;
-       long len = strlen(buf);
+       long len = config->str().length();
        
        ptr = 0;
        in_token = 0;