From a018f26eddbc72fdbf87fe5ee89112a53311fff1 Mon Sep 17 00:00:00 2001 From: danieldg Date: Tue, 2 Mar 2010 03:17:04 +0000 Subject: DelFd should not fail, it will leave a bad dangling pointer in that case git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12584 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socketengines/socketengine_select.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/socketengines/socketengine_select.cpp') diff --git a/src/socketengines/socketengine_select.cpp b/src/socketengines/socketengine_select.cpp index 3c33eb474..acc8f8f09 100644 --- a/src/socketengines/socketengine_select.cpp +++ b/src/socketengines/socketengine_select.cpp @@ -32,7 +32,7 @@ public: */ virtual ~SelectEngine(); virtual bool AddFd(EventHandler* eh, int event_mask); - virtual bool DelFd(EventHandler* eh, bool force = false); + virtual void DelFd(EventHandler* eh); void OnSetEvent(EventHandler* eh, int, int); virtual int DispatchEvents(); virtual std::string GetName(); @@ -69,18 +69,17 @@ bool SelectEngine::AddFd(EventHandler* eh, int event_mask) return true; } -bool SelectEngine::DelFd(EventHandler* eh, bool force) +void SelectEngine::DelFd(EventHandler* eh) { int fd = eh->GetFd(); if ((fd < 0) || (fd > GetMaxFds() - 1)) - return false; + return; CurrentSetSize--; ref[fd] = NULL; ServerInstance->Logs->Log("SOCKET",DEBUG,"Remove file descriptor: %d", fd); - return true; } void SelectEngine::OnSetEvent(EventHandler* eh, int old_mask, int new_mask) -- cgit v1.2.3