1
0
mirror of https://github.com/anope/anope.git synced 2026-06-27 11:36:38 +02:00

Merge usefulness of Flags and Extensible classes into Extensible, made most flags we have juse strings instead of defines/enums

This commit is contained in:
Adam
2013-01-21 22:31:16 -05:00
parent 51c049e1a7
commit ddaa001daf
128 changed files with 1857 additions and 2293 deletions
+7 -7
View File
@@ -22,10 +22,10 @@ Pipe::Pipe() : Socket(-1), write_pipe(-1)
int fds[2];
if (pipe(fds))
throw CoreException("Could not create pipe: " + Anope::LastError());
int flags = fcntl(fds[0], F_GETFL, 0);
fcntl(fds[0], F_SETFL, flags | O_NONBLOCK);
flags = fcntl(fds[1], F_GETFL, 0);
fcntl(fds[1], F_SETFL, flags | O_NONBLOCK);
int sflags = fcntl(fds[0], F_GETFL, 0);
fcntl(fds[0], F_SETFL, sflags | O_NONBLOCK);
sflags = fcntl(fds[1], F_GETFL, 0);
fcntl(fds[1], F_SETFL, sflags | O_NONBLOCK);
SocketEngine::Change(this, false, SF_READABLE);
SocketEngine::Change(this, false, SF_WRITABLE);
@@ -67,11 +67,11 @@ int Pipe::Read(char *data, size_t sz)
bool Pipe::SetWriteBlocking(bool state)
{
int flags = fcntl(this->write_pipe, F_GETFL, 0);
int f = fcntl(this->write_pipe, F_GETFL, 0);
if (state)
return !fcntl(this->write_pipe, F_SETFL, flags & ~O_NONBLOCK);
return !fcntl(this->write_pipe, F_SETFL, f & ~O_NONBLOCK);
else
return !fcntl(this->write_pipe, F_SETFL, flags | O_NONBLOCK);
return !fcntl(this->write_pipe, F_SETFL, f | O_NONBLOCK);
}
void Pipe::Notify()