1
0
mirror of https://github.com/anope/anope.git synced 2026-07-09 04:03:13 +02:00

Merge branch '2.0' into 2.1.

This commit is contained in:
Sadie Powell
2021-05-31 20:57:48 +01:00
21 changed files with 50 additions and 40 deletions
+2 -2
View File
@@ -62,9 +62,9 @@ BotInfo::~BotInfo()
IRCD->SendSQLineDel(&x);
}
for (std::set<ChannelInfo *>::iterator it = this->channels->begin(), it_end = this->channels->end(); it != it_end; ++it)
for (std::set<ChannelInfo *>::iterator it = this->channels->begin(), it_end = this->channels->end(); it != it_end;)
{
ChannelInfo *ci = *it;
ChannelInfo *ci = *it++;
this->UnAssign(NULL, ci);
}
+9 -4
View File
@@ -106,9 +106,12 @@ void Anope::Fork()
#ifndef _WIN32
kill(getppid(), SIGUSR2);
freopen("/dev/null", "r", stdin);
freopen("/dev/null", "w", stdout);
freopen("/dev/null", "w", stderr);
if (!freopen("/dev/null", "r", stdin))
Log() << "Unable to redirect stdin to /dev/null: " << Anope::LastError();
if (!freopen("/dev/null", "w", stdout))
Log() << "Unable to redirect stdout to /dev/null: " << Anope::LastError();
if (!freopen("/dev/null", "w", stderr))
Log() << "Unable to redirect stderr to /dev/null: " << Anope::LastError();
setpgid(0, 0);
@@ -263,7 +266,9 @@ static void setuidgid()
{
LogFile* lf = li.logfiles[j];
chown(lf->filename.c_str(), uid, gid);
errno = 0;
if (chown(lf->filename.c_str(), uid, gid) != 0)
Log() << "Unable to change the ownership of " << lf->filename << " to " << uid << "/" << gid << ": " << Anope::LastError();
}
}
+2 -2
View File
@@ -112,9 +112,9 @@ static std::string GetTimeStamp()
{
char tbuf[256];
time_t t = time(NULL);
struct tm *tm = localtime(&t);
struct tm *tm = gmtime(&t);
strftime(tbuf, sizeof(tbuf) - 1, "%a, %d %b %Y %H:%M:%S %z", tm);
strftime(tbuf, sizeof(tbuf) - 1, "%a, %d %b %Y %H:%M:%S +0000", tm);
return tbuf;
}
+1 -2
View File
@@ -94,14 +94,13 @@ UplinkSocket::~UplinkSocket()
}
IRCD->SendSquit(Me, Anope::QuitReason);
this->ProcessWrite(); // Write out the last bit
}
for (unsigned i = Me->GetLinks().size(); i > 0; --i)
if (!Me->GetLinks()[i - 1]->IsJuped())
Me->GetLinks()[i - 1]->Delete(Me->GetName() + " " + Me->GetLinks()[i - 1]->GetName());
this->ProcessWrite(); // Write out the last bit
UplinkSock = NULL;
Me->Unsync();