From d2efdbf6bb91229d043303b1694fefae79ea6fe7 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Sat, 17 Feb 2018 17:12:26 +0000 Subject: Fix building on Windows (mostly). --- src/modules/extra/m_mysql.cpp | 4 ++-- src/socketengine.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index a16a293d7..4ee6de527 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -145,7 +145,7 @@ class MySQLresult : public SQL::Result std::vector colnames; std::vector fieldlists; - MySQLresult(MYSQL_RES* res, int affected_rows) : err(SQL::NO_ERROR), currentrow(0), rows(0) + MySQLresult(MYSQL_RES* res, int affected_rows) : err(SQL::SUCCESS), currentrow(0), rows(0) { if (affected_rows >= 1) { @@ -541,7 +541,7 @@ void DispatcherThread::OnNotify() for(ResultQueue::iterator i = Parent->rq.begin(); i != Parent->rq.end(); i++) { MySQLresult* res = i->r; - if (res->err.code == SQL::NO_ERROR) + if (res->err.code == SQL::SUCCESS) i->q->OnResult(*res); else i->q->OnError(res->err); diff --git a/src/socketengine.cpp b/src/socketengine.cpp index 10a0e51a2..df6ff5a02 100644 --- a/src/socketengine.cpp +++ b/src/socketengine.cpp @@ -71,6 +71,9 @@ void SocketEngine::InitError() void SocketEngine::LookupMaxFds() { +#if defined _WIN32 + MaxSetSize = FD_SETSIZE; +#else struct rlimit limits; if (!getrlimit(RLIMIT_NOFILE, &limits)) MaxSetSize = limits.rlim_cur; @@ -82,6 +85,7 @@ void SocketEngine::LookupMaxFds() #endif if (!setrlimit(RLIMIT_NOFILE, &limits)) MaxSetSize = limits.rlim_cur; +#endif } void SocketEngine::ChangeEventMask(EventHandler* eh, int change) -- cgit v1.3.1-10-gc9f91