From 00bae113d54014bafcf20c9f4c8c296e3e91bde5 Mon Sep 17 00:00:00 2001 From: Quentin BUATHIER Date: Thu, 6 Dec 2018 09:16:51 +0100 Subject: Check the return code of pipe --- libvncserver/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3