diff --git a/libvncserver/main.c b/libvncserver/main.c index c34ae7e..17bef7e 100644 --- a/libvncserver/main.c +++ b/libvncserver/main.c @@ -642,7 +642,10 @@ rfbStartOnHoldClient(rfbClientPtr cl) cl->onHold = FALSE; #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD if(cl->screen->backgroundLoop) { - pipe(cl->pipe_notify_client_thread); + if (pipe(cl->pipe_notify_client_thread) == -1) { + cl->pipe_notify_client_thread[0] = -1; + cl->pipe_notify_client_thread[1] = -1; + } fcntl(cl->pipe_notify_client_thread[0], F_SETFL, O_NONBLOCK); pthread_create(&cl->client_thread, NULL, clientInput, (void *)cl);