summaryrefslogtreecommitdiffstats
path: root/libvncclient/listen.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvncclient/listen.c')
-rw-r--r--libvncclient/listen.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libvncclient/listen.c b/libvncclient/listen.c
index 2461dcf..1e6f68b 100644
--- a/libvncclient/listen.c
+++ b/libvncclient/listen.c
@@ -43,7 +43,8 @@ listenForIncomingConnections(rfbClient* client)
listenSocket = ListenAtTcpPort(client->listenPort);
- if ((listenSocket < 0)) exit(1);
+ if ((listenSocket < 0))
+ return;
rfbClientLog("%s -listen: Listening on port %d\n",
client->programName,client->listenPort);
@@ -66,8 +67,10 @@ listenForIncomingConnections(rfbClient* client)
if (FD_ISSET(listenSocket, &fds)) {
client->sock = AcceptTcpConnection(listenSocket);
- if (client->sock < 0) exit(1);
- if (!SetNonBlocking(client->sock)) exit(1);
+ if (client->sock < 0)
+ return;
+ if (!SetNonBlocking(client->sock))
+ return;
/* Now fork off a new process to deal with it... */
@@ -75,7 +78,7 @@ listenForIncomingConnections(rfbClient* client)
case -1:
perror("fork");
- exit(1);
+ return;
case 0:
/* child - return to caller */