diff --git a/server/libvncserver/sockets.c b/server/libvncserver/sockets.c
index bbdaf3d..4074500 100644
--- a/server/libvncserver/sockets.c
+++ b/server/libvncserver/sockets.c
@@ -346,9 +346,7 @@ rfbCloseClient(cl)
     rfbAuthCleanupClient(cl);
 
     LOCK(cl->updateMutex);
-#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
     if (cl->sock != -1)
-#endif
       {
 	FD_CLR(cl->sock,&(cl->screen->allFds));
 	if(cl->sock==cl->screen->maxFd)
