* ---------------------------------------------------
*/
+using namespace std;
+
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/types.h>
#include "inspircd_io.h"
#include "inspircd_util.h"
#include "inspstring.h"
-
-using namespace std;
+#include "helperfuncs.h"
extern FILE *log_file;
extern int boundPortCount;
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)
}
}
-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)
{
const char* buf = config->str().c_str();
long bptr = 0;
- long len = strlen(buf);
+ long len = config->str().length();
ptr = 0;
in_token = 0;
}
else
{
- listen(sockfd,5);
+ listen(sockfd,32);
return(TRUE);
}
}