/* Burlex: Moved from exitcodes.h -- due to duplicate symbols */
const char* ExitCodes[] =
{
- "No error", /* 0 */
+ "No error", /* 0 */
"DIE command", /* 1 */
"execv() failed", /* 2 */
"Internal error", /* 3 */
for(; itr != servernames.end(); ++itr)
if(**itr == servername)
return true;
- return false;
+ return false;
}
void InspIRCd::Exit(int status)
this->Cleanup();
/* Figure out our filename (if theyve renamed it, we're boned) */
+ std::string me;
+
#ifdef WINDOWS
- std::string me = Config->MyDir + "inspircd.exe";
+ char module[MAX_PATH];
+ if (GetModuleFileName(NULL, module, MAX_PATH))
+ me = module;
#else
- std::string me = Config->MyDir + "/inspircd";
+ me = Config->MyDir + "/inspircd";
#endif
if (execv(me.c_str(), Config->argv) == -1)
sh.lpVerb = 0;
sh.lpDirectory = 0;
sh.hInstApp = 0;
- sh.nShow = SW_SHOW;
+ sh.nShow = SW_HIDE;
sh.lpFile = "inspircd.exe";
sh.lpParameters = "--service";
if(!ShellExecuteEx(&sh))
{ "debug", no_argument, &do_debug, 1 },
{ "nolog", no_argument, &do_nolog, 1 },
{ "runasroot", no_argument, &do_root, 1 },
- { "version", no_argument, &do_version, 1 },
- { "service", no_argument, &is_service, 1 },
+ { "version", no_argument, &do_version, 1 },
+ { "service", no_argument, &is_service, 1 },
{ 0, 0, 0, 0 }
};
}
- /* Because of limitations in kqueue on freebsd, we must fork BEFORE we
+ /* Because of limitations in kqueue on freebsd, we must fork BEFORE we
* initialize the socket engine.
*/
SocketEngineFactory* SEF = new SocketEngineFactory();
{
if (v2 == j)
{
- Config->module_names.erase(v);
- break;
+ Config->module_names.erase(v);
+ break;
}
v2++;
}
{
int n_match = 0;
DIR* library = opendir(Config->ModPath);
- if (library)
- {
+ if (library)
+ {
/* Try and locate and load all modules matching the pattern */
dirent* entry = NULL;
while ((entry = readdir(library)))
}
else
{
- this->Log(DEFAULT,"Unable to load %s",modfile);
+ this->Log(DEFAULT,"Unable to load %s",modfile);
snprintf(MODERR,MAXBUF,"Factory function failed: Probably missing init_module() entrypoint.");
return false;
}
void InspIRCd::DoOneIteration(bool process_module_sockets)
{
#ifndef WIN32
- static rusage ru;
+ static rusage ru;
#endif
/* time() seems to be a pretty expensive syscall, so avoid calling it too much.
if (log)
{
/* Burlex: Windows assumes nonblocking on FILE* pointers anyway, and also "file" fd's aren't the same
- as socket fd's. */
+ * as socket fd's. */
#ifndef WIN32
- int flags = fcntl(fileno(log), F_GETFL, 0);
+ int flags = fcntl(fileno(log), F_GETFL, 0);
fcntl(fileno(log), F_SETFL, flags ^ O_NONBLOCK);
#endif
if (buffer.size())