diff options
author | Adam <Adam@anope.org> | 2013-01-21 22:31:16 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-01-21 22:31:16 -0500 |
commit | ddaa001dafb5122e6e363e4acbbe6ce045b7b104 (patch) | |
tree | 0364a76606ac6e2881ebd663601ce260f7c1101e /src/pipeengine.cpp | |
parent | 51c049e1a738e9124bab3961f35b830906517421 (diff) |
Merge usefulness of Flags and Extensible classes into Extensible, made most flags we have juse strings instead of defines/enums
Diffstat (limited to 'src/pipeengine.cpp')
-rw-r--r-- | src/pipeengine.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pipeengine.cpp b/src/pipeengine.cpp index 5071db9d0..3219a0e05 100644 --- a/src/pipeengine.cpp +++ b/src/pipeengine.cpp @@ -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() |