summaryrefslogtreecommitdiffstats
path: root/libvncserver
diff options
context:
space:
mode:
authordscho <dscho>2004-12-01 23:06:56 +0000
committerdscho <dscho>2004-12-01 23:06:56 +0000
commit658b65ad0cc2045bf2c930c8ef2a2853a07ba6ee (patch)
tree51a7b1f153204de2c3bc423411d8f5b2f566c4f6 /libvncserver
parent7d3b1c9762b5f2878e9783677677cb2b3aa10e7e (diff)
downloadlibtdevnc-658b65ad0cc2045bf2c930c8ef2a2853a07ba6ee.tar.gz
libtdevnc-658b65ad0cc2045bf2c930c8ef2a2853a07ba6ee.zip
support MinGW32!
Diffstat (limited to 'libvncserver')
-rwxr-xr-xlibvncserver/httpd.c5
-rw-r--r--libvncserver/main.c2
-rwxr-xr-xlibvncserver/sockets.c23
3 files changed, 17 insertions, 13 deletions
diff --git a/libvncserver/httpd.c b/libvncserver/httpd.c
index 13588b4..e169c30 100755
--- a/libvncserver/httpd.c
+++ b/libvncserver/httpd.c
@@ -161,6 +161,9 @@ rfbHttpCheckFds(rfbScreenInfoPtr rfbScreen)
rfbLogPerror("httpCheckFds: accept");
return;
}
+#ifdef __MINGW32__
+ rfbErr("O_NONBLOCK on MinGW32 NOT IMPLEMENTED");
+#else
#ifdef USE_LIBWRAP
if(!hosts_ctl("vnc",STRING_UNKNOWN,inet_ntoa(addr.sin_addr),
STRING_UNKNOWN)) {
@@ -176,6 +179,7 @@ rfbHttpCheckFds(rfbScreenInfoPtr rfbScreen)
rfbScreen->httpSock = -1;
return;
}
+
flags=fcntl(rfbScreen->httpSock,F_GETFL);
if(flags==-1 ||
fcntl(rfbScreen->httpSock,F_SETFL,flags|O_NONBLOCK)==-1) {
@@ -184,6 +188,7 @@ rfbHttpCheckFds(rfbScreenInfoPtr rfbScreen)
rfbScreen->httpSock=-1;
return;
}
+#endif
/*AddEnabledDevice(httpSock);*/
}
diff --git a/libvncserver/main.c b/libvncserver/main.c
index 97f0bc7..96aeda7 100644
--- a/libvncserver/main.c
+++ b/libvncserver/main.c
@@ -762,8 +762,10 @@ void rfbInitServer(rfbScreenInfoPtr screen)
#endif
rfbInitSockets(screen);
rfbHttpInitSockets(screen);
+#ifndef __MINGW32__
if(screen->ignoreSIGPIPE)
signal(SIGPIPE,SIG_IGN);
+#endif
}
#ifndef LIBVNCSERVER_HAVE_GETTIMEOFDAY
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;