X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fnet%2Funix%2Fsocket.cpp;h=d87cdd3a72907109133929d5b8a405e6237cc2cf;hb=cc2e643d6ec3025db3fb6f0a4c1f77af05cf1026;hp=a9e9c58362d0f44faad9ae310157ecfd345e5c83;hpb=647e0e3df1ddb4208492a8c336bf12741f5146c0;p=libs%2Fnet.git diff --git a/source/net/unix/socket.cpp b/source/net/unix/socket.cpp index a9e9c58..d87cdd3 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 { @@ -44,7 +46,7 @@ void Socket::Private::set_block(bool b) void Socket::Private::set_inherit(bool i) { int flags = fcntl(handle, F_GETFD); - fcntl(handle, F_SETFD, (flags&~O_CLOEXEC)|(i?O_CLOEXEC:0)); + fcntl(handle, F_SETFD, (flags&~O_CLOEXEC)|(i?0:O_CLOEXEC)); } int Socket::Private::set_option(int level, int optname, const void *optval, socklen_t optlen) @@ -58,7 +60,7 @@ 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) {