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 Net_SocketDefs_INCLUDED
#define POCO_ENOERR 0
#if defined(POCO_OS_FAMILY_WINDOWS) #if defined(POCO_OS_FAMILY_WINDOWS)
#include "Poco/UnWindows.h" #include "Poco/UnWindows.h"
#include <winsock2.h> #include <winsock2.h>

View File

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