X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Finspircd.cpp;h=344e2a47363132d995b62f8ce4a388fdd6a19715;hb=ac705cd20e12f46bd638093f000dfd541ffc5d22;hp=cb50595d227f81a6623e2ddf1178802dc3b77cba;hpb=ebdaf368e137fc933e648ee88a08a4f83e796f87;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/inspircd.cpp b/src/inspircd.cpp index cb50595d2..344e2a473 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -119,7 +119,7 @@ void InspIRCd::Cleanup() ports.clear(); /* Close all client sockets, or the new process inherits them */ - std::vector::reverse_iterator i = Users->local_users.rbegin(); + LocalUserList::reverse_iterator i = Users->local_users.rbegin(); while (i != this->Users->local_users.rend()) { User* u = *i++; @@ -219,7 +219,7 @@ void InspIRCd::RehashUsersAndChans() // Reset the already_sent IDs so we don't wrap it around and drop a message LocalUser::already_sent_id = 0; - for (std::vector::const_iterator i = Users->local_users.begin(); i != Users->local_users.end(); i++) + for (LocalUserList::const_iterator i = Users->local_users.begin(); i != Users->local_users.end(); i++) { (**i).already_sent = 0; (**i).RemoveExpiredInvites(); @@ -355,6 +355,7 @@ InspIRCd::InspIRCd(int argc, char** argv) : this->Modes = 0; this->Res = 0; this->ConfigThread = NULL; + this->FakeClient = NULL; UpdateTime(); this->startup_time = TIME.tv_sec; @@ -426,7 +427,7 @@ InspIRCd::InspIRCd(int argc, char** argv) : }; int index; - while ((c = getopt_long(argc, argv, ":f:", longopts, &index)) != -1) + while ((c = getopt_long(argc, argv, ":c:f:", longopts, &index)) != -1) { switch (c) { @@ -630,18 +631,17 @@ InspIRCd::InspIRCd(int argc, char** argv) : */ if ((!do_nofork) && (!do_testsuite) && (!Config->cmdline.forcedebug)) { - int fd; + int fd = open("/dev/null", O_RDWR); fclose(stdin); fclose(stderr); fclose(stdout); - fd = open("/dev/null", O_RDWR); - if (dup2(fd, 0) < 0) + if (dup2(fd, STDIN_FILENO) < 0) Logs->Log("STARTUP", DEFAULT, "Failed to dup /dev/null to stdin."); - if (dup2(fd, 1) < 0) + if (dup2(fd, STDOUT_FILENO) < 0) Logs->Log("STARTUP", DEFAULT, "Failed to dup /dev/null to stdout."); - if (dup2(fd, 2) < 0) + if (dup2(fd, STDERR_FILENO) < 0) Logs->Log("STARTUP", DEFAULT, "Failed to dup /dev/null to stderr."); close(fd); } @@ -789,7 +789,6 @@ int InspIRCd::Run() */ if (TIME.tv_sec != OLDTIME) { - OLDTIME = TIME.tv_sec; #ifndef _WIN32 getrusage(RUSAGE_SELF, &ru); stats->LastSampled = TIME; @@ -816,6 +815,8 @@ int InspIRCd::Run() { SNO->WriteToSnoMask('d', "\002EH?!\002 -- Time is jumping FORWARDS! Clock skipped %lu secs.", (unsigned long)TIME.tv_sec - OLDTIME); } + + OLDTIME = TIME.tv_sec; if ((TIME.tv_sec % 3600) == 0) {