]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/inspircd_io.cpp
Signal handlers were not being set when -nofork was enabled
[user/henk/code/inspircd.git] / src / inspircd_io.cpp
index 1308a8dc9423daf66efb98351162b8e411051b36..dd5b146922c11e32278e4787c038aabdd66828d4 100644 (file)
@@ -404,15 +404,19 @@ void WritePID(std::string filename)
        }
 }
 
-
-int DaemonSeed (void)
+void SetSignals()
 {
-       int childpid;
        signal (SIGALRM, SIG_IGN);
        signal (SIGHUP, Rehash);
        signal (SIGPIPE, SIG_IGN);
        signal (SIGTERM, Exit);
        signal (SIGSEGV, Error);
+}
+
+
+int DaemonSeed (void)
+{
+       int childpid;
        if ((childpid = fork ()) < 0)
                return (ERROR);
        else if (childpid > 0)
@@ -936,7 +940,7 @@ int ServerConfig::ReadConf(std::stringstream *config, const char* tag, const cha
                                                if (!key)
                                                {
                                                        /* value not found in tag */
-                                                       strcpy(result,"");
+                                                       *result = 0;
                                                        return 0;
                                                }
                                                else
@@ -947,7 +951,7 @@ int ServerConfig::ReadConf(std::stringstream *config, const char* tag, const cha
                                                                if (!*key)
                                                                {
                                                                        /* missing quote */
-                                                                       strcpy(result,"");
+                                                                       *result = 0;
                                                                        return 0;
                                                                }
                                                                key++;
@@ -985,7 +989,7 @@ int ServerConfig::ReadConf(std::stringstream *config, const char* tag, const cha
                        }
                }
        }
-       strcpy(result,""); // value or its tag not found at all
+       *result = 0; // value or its tag not found at all
        return 0;
 }