Skip to content

Commit b2ede8d

Browse files
efimbushmanovEfim Bushmanov
andauthored
libvncserver: be more clear about code intention
* fix "backgroundLoop != FALSE" means true thingy, add missed screen->backgroundLoop check if LIBPTHREAD defined * fix "small improv Co-authored-by: Efim Bushmanov <you@example.com>
1 parent 2aa20da commit b2ede8d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

libvncserver/rfbserver.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ rfbClientConnectionGone(rfbClientPtr cl)
554554
UNLOCK(rfbClientListMutex);
555555

556556
#if defined(LIBVNCSERVER_HAVE_LIBPTHREAD) || defined(LIBVNCSERVER_HAVE_WIN32THREADS)
557-
if(cl->screen->backgroundLoop != FALSE) {
557+
if (cl->screen->backgroundLoop) {
558558
int i;
559559
do {
560560
LOCK(cl->refCountMutex);
@@ -626,8 +626,10 @@ rfbClientConnectionGone(rfbClientPtr cl)
626626
TINI_MUTEX(cl->sendMutex);
627627

628628
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
629-
close(cl->pipe_notify_client_thread[0]);
630-
close(cl->pipe_notify_client_thread[1]);
629+
if (cl->screen->backgroundLoop) {
630+
close(cl->pipe_notify_client_thread[0]);
631+
close(cl->pipe_notify_client_thread[1]);
632+
}
631633
#endif
632634

633635
rfbPrintStats(cl);

0 commit comments

Comments
 (0)