mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-23 16:48:06 +02:00
added POCO_ENOERR
silence gcc warning and shiled from accidentally throwing on no error
This commit is contained in:
@@ -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>
|
||||||
|
@@ -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:
|
||||||
|
Reference in New Issue
Block a user