signal(SIGHUP, InspIRCd::SetSignal);
signal(SIGPIPE, SIG_IGN);
signal(SIGCHLD, SIG_IGN);
signal(SIGHUP, InspIRCd::SetSignal);
signal(SIGPIPE, SIG_IGN);
signal(SIGCHLD, SIG_IGN);
#ifdef WIN32
// Strict, frequent checking of memory on debug builds
_CrtSetDbgFlag ( _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#ifdef WIN32
// Strict, frequent checking of memory on debug builds
_CrtSetDbgFlag ( _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
FailedPortList pl;
int do_version = 0, do_nofork = 0, do_debug = 0,
do_nolog = 0, do_root = 0, do_testsuite = 0; /* flag variables */
FailedPortList pl;
int do_version = 0, do_nofork = 0, do_debug = 0,
do_nolog = 0, do_root = 0, do_testsuite = 0; /* flag variables */
// Create base manager classes early, so nothing breaks
this->Users = new UserManager(this);
// Create base manager classes early, so nothing breaks
this->Users = new UserManager(this);
- while ((c = getopt_long_only(argc, argv, ":f:", longopts, NULL)) != -1)
+ int index;
+ while ((c = getopt_long_only(argc, argv, ":f:", longopts, &index)) != -1)
printf("Usage: %s [--nofork] [--nolog] [--debug] [--logfile <filename>]\n\
[--runasroot] [--version] [--config <config>] [--testsuite]\n", argv[0]);
Exit(EXIT_STATUS_ARGV);
printf("Usage: %s [--nofork] [--nolog] [--debug] [--logfile <filename>]\n\
[--runasroot] [--version] [--config <config>] [--testsuite]\n", argv[0]);
Exit(EXIT_STATUS_ARGV);
/* Windows can (and defaults to) hide file extensions, so let's play a bit nice for windows users. */
std::string txtconf = this->ConfigFileName;
txtconf.append(".txt");
/* Windows can (and defaults to) hide file extensions, so let's play a bit nice for windows users. */
std::string txtconf = this->ConfigFileName;
txtconf.append(".txt");
if (ServerConfig::FileExists(txtconf.c_str()))
{
strlcat(this->ConfigFileName, ".txt", MAXBUF);
if (ServerConfig::FileExists(txtconf.c_str()))
{
strlcat(this->ConfigFileName, ".txt", MAXBUF);
/* Just in case no modules were loaded - fix for bug #101 */
this->BuildISupport();
InitializeDisabledCommands(Config->DisabledCommands, this);
/* Just in case no modules were loaded - fix for bug #101 */
this->BuildISupport();
InitializeDisabledCommands(Config->DisabledCommands, this);
}
printf("\nInspIRCd is now running as '%s'[%s] with %d max open sockets\n", Config->ServerName,Config->GetSID().c_str(), SE->GetMaxFds());
}
printf("\nInspIRCd is now running as '%s'[%s] with %d max open sockets\n", Config->ServerName,Config->GetSID().c_str(), SE->GetMaxFds());
/* time() seems to be a pretty expensive syscall, so avoid calling it too much.
* Once per loop iteration is pleanty.
/* time() seems to be a pretty expensive syscall, so avoid calling it too much.
* Once per loop iteration is pleanty.