X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Funix%2Fsocket.cpp;h=2c1e2ad8d355ac9e0fe9a31b5292f0709535c2f8;hb=HEAD;hp=970b9aedd3be443dff55e6500a296719041ea678;hpb=b97d82a641331b097d6ae973d0a99a3818e9ccc2;p=libs%2Fnet.git diff --git a/source/net/unix/socket.cpp b/source/net/unix/socket.cpp index 970b9ae..2c1e2ad 100644 --- a/source/net/unix/socket.cpp +++ b/source/net/unix/socket.cpp @@ -1,14 +1,16 @@ +#include "platform_api.h" +#include "socket.h" #include #include #include -#include "platform_api.h" #include #include #include #include "sockaddr_private.h" -#include "socket.h" #include "socket_private.h" +using namespace std; + namespace Msp { namespace Net { @@ -58,11 +60,11 @@ int Socket::Private::get_option(int level, int optname, void *optval, socklen_t } -unsigned check_sys_error(int ret, const char *func) +size_t check_sys_error(make_signed::type ret, const char *func) { if(ret<0) { - if(errno==EAGAIN) + if(errno==EAGAIN || errno==EWOULDBLOCK) return 0; else throw system_error(func);