summaryrefslogtreecommitdiffstats
path: root/libvncclient/listen.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvncclient/listen.c')
-rw-r--r--libvncclient/listen.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libvncclient/listen.c b/libvncclient/listen.c
index 37def52..4ecedff 100644
--- a/libvncclient/listen.c
+++ b/libvncclient/listen.c
@@ -22,7 +22,12 @@
* listen.c - listen for incoming connections
*/
+#ifdef __STRICT_ANSI__
+#define _BSD_SOURCE
+#endif
+#if LIBVNCSERVER_HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <sys/types.h>
#ifdef WIN32
#define close closesocket
@@ -31,7 +36,9 @@
#include <sys/wait.h>
#include <sys/utsname.h>
#endif
+#if LIBVNCSERVER_HAVE_SYS_TIME_H
#include <sys/time.h>
+#endif
#include <rfb/rfbclient.h>
/*
@@ -82,7 +89,7 @@ listenForIncomingConnections(rfbClient* client)
int r;
/* reap any zombies */
int status, pid;
- while ((pid= wait3(&status, WNOHANG, (struct rusage *)0))>0);
+ while ((pid= wait4(-1, &status, WNOHANG, (struct rusage *)0))>0);
/* TODO: callback for discard any events (like X11 events) */