summaryrefslogtreecommitdiff
path: root/src/socketengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/socketengine.cpp')
-rw-r--r--src/socketengine.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/socketengine.cpp b/src/socketengine.cpp
index e00657a54..23088edb9 100644
--- a/src/socketengine.cpp
+++ b/src/socketengine.cpp
@@ -41,12 +41,13 @@ SocketEngine::~SocketEngine()
char SocketEngine::GetType(int fd)
{
/* Mask off the top bit used for 'read/write' state */
- return (ref[fd] & 0x7F);
+ return (ref[fd] & ~0x80);
}
bool SocketEngine::AddFd(int fd, bool readable, char type)
{
this->fds.push_back(fd);
+ ref[fd] = type;
if (readable)
ref[fd] |= X_READBIT;
#ifdef USE_EPOLL