summaryrefslogtreecommitdiffstats
path: root/sockets.c
diff options
context:
space:
mode:
authordscho <dscho>2001-10-10 15:07:17 +0000
committerdscho <dscho>2001-10-10 15:07:17 +0000
commitfad7881732f39780fecd0a0c678392f002b88e26 (patch)
treee04eb7c43100a2eefd51222fb15550b289c882dd /sockets.c
parent631d3be5408c9b487bb75ecc25177de4901b71d5 (diff)
downloadlibtdevnc-fad7881732f39780fecd0a0c678392f002b88e26.tar.gz
libtdevnc-fad7881732f39780fecd0a0c678392f002b88e26.zip
pthreads corrections
Diffstat (limited to 'sockets.c')
-rw-r--r--sockets.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sockets.c b/sockets.c
index 760dc08..776fc49 100644
--- a/sockets.c
+++ b/sockets.c
@@ -111,16 +111,18 @@ rfbInitSockets(rfbScreenInfoPtr rfbScreen)
return;
}
- rfbLog("Listening for VNC connections on TCP port %d\n", rfbScreen->rfbPort);
+ if(rfbScreen->rfbPort>0) {
+ rfbLog("Listening for VNC connections on TCP port %d\n", rfbScreen->rfbPort);
- if ((rfbScreen->rfbListenSock = ListenOnTCPPort(rfbScreen->rfbPort)) < 0) {
+ if ((rfbScreen->rfbListenSock = ListenOnTCPPort(rfbScreen->rfbPort)) < 0) {
rfbLogPerror("ListenOnTCPPort");
exit(1);
- }
+ }
- FD_ZERO(&(rfbScreen->allFds));
- FD_SET(rfbScreen->rfbListenSock, &(rfbScreen->allFds));
- rfbScreen->maxFd = rfbScreen->rfbListenSock;
+ FD_ZERO(&(rfbScreen->allFds));
+ FD_SET(rfbScreen->rfbListenSock, &(rfbScreen->allFds));
+ rfbScreen->maxFd = rfbScreen->rfbListenSock;
+ }
if (rfbScreen->udpPort != 0) {
rfbLog("rfbInitSockets: listening for input on UDP port %d\n",rfbScreen->udpPort);
@@ -159,7 +161,6 @@ rfbCheckFds(rfbScreenInfoPtr rfbScreen,long usec)
if (!rfbScreen->inetdInitDone && rfbScreen->inetdSock != -1) {
rfbNewClientConnection(rfbScreen,rfbScreen->inetdSock);
rfbScreen->inetdInitDone = TRUE;
- FD_SET(rfbScreen->inetdSock,&(rfbScreen->allFds));
}
memcpy((char *)&fds, (char *)&(rfbScreen->allFds), sizeof(fd_set));