X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspircd.cpp;h=c0d7a1614c53168b91525ae81c70c112378b8d6c;hb=aa885c1661979b43ab26a682e46ab93306ff8015;hp=a32c079318b46c8412424a11d7bb997e9f71984a;hpb=4f9abe96a4301a740d4a5fd7932550d88d60a3fc;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspircd.cpp b/src/inspircd.cpp index a32c07931..c0d7a1614 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -1,13 +1,14 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2020 Matt Schatz * Copyright (C) 2018 Chris Novakovic - * Copyright (C) 2013, 2017-2020 Sadie Powell + * Copyright (C) 2013, 2018-2021 Sadie Powell * Copyright (C) 2013 Adam * Copyright (C) 2012-2014, 2016, 2018 Attila Molnar - * Copyright (C) 2012 William Pitcock * Copyright (C) 2012 Robby * Copyright (C) 2012 ChrisTX + * Copyright (C) 2012 Ariadne Conill * Copyright (C) 2009-2010 Daniel De Graaf * Copyright (C) 2009 Uli Schlachter * Copyright (C) 2008 Thomas Stagner @@ -321,7 +322,7 @@ namespace default: // An unknown option was specified. - std::cout << con_red << "Error:" << con_reset << " unknown option '" << argv[optind - 1] << "'." << std::endl + std::cout << con_red << "Error:" << con_reset << " unknown option '" << argv[optind] << "'." << std::endl << con_bright << "Usage: " << con_reset << argv[0] << " [--config ] [--debug] [--nofork] [--nolog]" << std::endl << std::string(strlen(argv[0]) + 8, ' ') << "[--nopid] [--runasroot] [--version]" << std::endl; ServerInstance->Exit(EXIT_STATUS_ARGV); @@ -331,7 +332,7 @@ namespace if (do_version) { - std::cout << std::endl << INSPIRCD_VERSION << std::endl; + std::cout << INSPIRCD_VERSION << std::endl; ServerInstance->Exit(EXIT_STATUS_NOERROR); } @@ -387,7 +388,7 @@ namespace std::cout << con_bright << "Hints:" << con_reset << std::endl << "- For TCP/IP listeners try using a public IP address in instead" << std::endl - << " of * of leaving it blank." << std::endl + << " of * or leaving it blank." << std::endl << "- For UNIX socket listeners try enabling to replace old sockets." << std::endl; } } @@ -444,7 +445,7 @@ void InspIRCd::WritePID(const std::string& filename, bool exitonfail) return; } - std::string fname = ServerInstance->Config->Paths.PrependData(filename.empty() ? "inspircd.pid" : filename); + std::string fname = ServerInstance->Config->Paths.PrependRuntime(filename.empty() ? "inspircd.pid" : filename); std::ofstream outfile(fname.c_str()); if (outfile.is_open()) { @@ -489,6 +490,7 @@ InspIRCd::InspIRCd(int argc, char** argv) this->Config->cmdline.argv = argv; this->Config->cmdline.argc = argc; + ParseOptions(); #ifdef _WIN32 // Initialize the console values @@ -520,10 +522,10 @@ InspIRCd::InspIRCd(int argc, char** argv) << "See " << con_green << "/INFO" << con_reset << " for contributors & authors" << std::endl << std::endl; - ParseOptions(); if (Config->cmdline.forcedebug) { - FileWriter* fw = new FileWriter(stdout, 1); + FILE* newstdout = fdopen(dup(STDOUT_FILENO), "w"); + FileWriter* fw = new FileWriter(newstdout, 1); FileLogStream* fls = new FileLogStream(LOG_RAWIO, fw); Logs->AddLogTypes("*", fls, true); }