diff options
author | dscho <dscho> | 2004-12-01 23:06:56 +0000 |
---|---|---|
committer | dscho <dscho> | 2004-12-01 23:06:56 +0000 |
commit | 658b65ad0cc2045bf2c930c8ef2a2853a07ba6ee (patch) | |
tree | 51a7b1f153204de2c3bc423411d8f5b2f566c4f6 /libvncserver/sockets.c | |
parent | 7d3b1c9762b5f2878e9783677677cb2b3aa10e7e (diff) | |
download | libtdevnc-658b65ad0cc2045bf2c930c8ef2a2853a07ba6ee.tar.gz libtdevnc-658b65ad0cc2045bf2c930c8ef2a2853a07ba6ee.zip |
support MinGW32!
Diffstat (limited to 'libvncserver/sockets.c')
-rwxr-xr-x | libvncserver/sockets.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/libvncserver/sockets.c b/libvncserver/sockets.c index 5ded1c7..0937097 100755 --- a/libvncserver/sockets.c +++ b/libvncserver/sockets.c @@ -45,14 +45,6 @@ #include <sys/types.h> #endif -#ifdef WIN32 -#pragma warning (disable: 4018 4761) -#define close closesocket -#define read(sock,buf,len) recv(sock,buf,len,0) -#define EWOULDBLOCK WSAEWOULDBLOCK -#define ETIMEDOUT WSAETIMEDOUT -#define write(sock,buf,len) send(sock,buf,len,0) -#else #ifdef LIBVNCSERVER_HAVE_SYS_TIME_H #include <sys/time.h> #endif @@ -68,7 +60,6 @@ #ifdef LIBVNCSERVER_HAVE_UNISTD_H #include <unistd.h> #endif -#endif #if defined(__linux__) && defined(NEED_TIMEVAL) struct timeval @@ -91,10 +82,14 @@ int allow_severity=LOG_INFO; int deny_severity=LOG_WARNING; #endif -/*#ifndef WIN32 -int max(int i,int j) { return(i<j?j:i); } +#if defined(WIN32) +#pragma warning (disable: 4018 4761) +#define close closesocket +#define read(sock,buf,len) recv(sock,buf,len,0) +#define EWOULDBLOCK WSAEWOULDBLOCK +#define ETIMEDOUT WSAETIMEDOUT +#define write(sock,buf,len) send(sock,buf,len,0) #endif -*/ int rfbMaxClientWait = 20000; /* time (ms) after which we decide client has gone away - needed to stop us hanging */ @@ -334,7 +329,9 @@ rfbCloseClient(cl) while(cl->screen->maxFd>0 && !FD_ISSET(cl->screen->maxFd,&(cl->screen->allFds))) cl->screen->maxFd--; +#ifndef __MINGW32__ shutdown(cl->sock,SHUT_RDWR); +#endif close(cl->sock); cl->sock = -1; } @@ -414,7 +411,7 @@ rfbReadExactTimeout(rfbClientPtr cl, char* buf, int len, int timeout) } else { #ifdef WIN32 - errno = WSAGetLastError(); + errno = WSAGetLastError(); #endif if (errno == EINTR) continue; |