summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin BUATHIER <qbuathier@tetrane.com>2018-12-06 09:16:51 +0100
committerQuentin BUATHIER <qbuathier@tetrane.com>2018-12-06 09:16:51 +0100
commit00bae113d54014bafcf20c9f4c8c296e3e91bde5 (patch)
tree6e082fd693deacade4d1b00330e251e047e8bbfa
parentcedae6e6f97b14f5df3ea7c5f7efd59f2bc9ad82 (diff)
downloadlibtdevnc-00bae113d54014bafcf20c9f4c8c296e3e91bde5.tar.gz
libtdevnc-00bae113d54014bafcf20c9f4c8c296e3e91bde5.zip
Check the return code of pipe
-rw-r--r--libvncserver/main.c5
1 files changed, 4 insertions, 1 deletions
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);