added POCO_ENOERR

silence gcc warning and shiled from accidentally throwing on no error
This commit is contained in:
aleks-f
2013-01-05 15:00:25 -06:00
parent 0d9e18ba7c
commit 73a3a5e288
2 changed files with 10 additions and 7 deletions

View File

@@ -40,6 +40,9 @@
#define Net_SocketDefs_INCLUDED
#define POCO_ENOERR 0
#if defined(POCO_OS_FAMILY_WINDOWS)
#include "Poco/UnWindows.h"
#include <winsock2.h>

View File

@@ -518,7 +518,7 @@ bool SocketImpl::poll(const Poco::Timespan& timeout, int mode)
FD_SET(sockfd, &fdExcept);
}
Poco::Timespan remainingTime(timeout);
int errorCode;
int errorCode = POCO_ENOERR;
int rc;
do
{
@@ -892,8 +892,7 @@ void SocketImpl::setBlocking(bool flag)
#else
int arg = fcntl(F_GETFL);
long flags = arg & ~O_NONBLOCK;
if (!flag)
flags |= O_NONBLOCK;
if (!flag) flags |= O_NONBLOCK;
(void) fcntl(F_SETFL, flags);
#endif
_blocking = flag;
@@ -999,6 +998,7 @@ void SocketImpl::error(int code, const std::string& arg)
{
switch (code)
{
case POCO_ENOERR: return;
case POCO_ESYSNOTREADY:
throw NetException("Net subsystem not ready", code);
case POCO_ENOTINIT: