logMutex needs to be initialized too; in rfbDefaultLog.

pull/1/head
runge 19 years ago
parent 57cf0cdab5
commit 9b3163c00b

@ -38,6 +38,8 @@
#include <signal.h> #include <signal.h>
#include <time.h> #include <time.h>
static int extMutex_initialized = 0;
static int logMutex_initialized = 0;
#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
static MUTEX(logMutex); static MUTEX(logMutex);
static MUTEX(extMutex); static MUTEX(extMutex);
@ -61,7 +63,6 @@ void
rfbRegisterProtocolExtension(rfbProtocolExtension* extension) rfbRegisterProtocolExtension(rfbProtocolExtension* extension)
{ {
rfbProtocolExtension* last; rfbProtocolExtension* last;
static int extMutex_initialized = 0;
if (! extMutex_initialized) { if (! extMutex_initialized) {
INIT_MUTEX(extMutex); INIT_MUTEX(extMutex);
@ -152,6 +153,11 @@ rfbDefaultLog(const char *format, ...)
if(!rfbEnableLogging) if(!rfbEnableLogging)
return; return;
if (! logMutex_initialized) {
INIT_MUTEX(logMutex);
logMutex_initialized = 1;
}
LOCK(logMutex); LOCK(logMutex);
va_start(args, format); va_start(args, format);
@ -654,7 +660,11 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv,
{ {
rfbScreenInfoPtr screen=calloc(sizeof(rfbScreenInfo),1); rfbScreenInfoPtr screen=calloc(sizeof(rfbScreenInfo),1);
INIT_MUTEX(logMutex); if (! logMutex_initialized) {
INIT_MUTEX(logMutex);
logMutex_initialized = 1;
}
if(width&3) if(width&3)
rfbErr("WARNING: Width (%d) is not a multiple of 4. VncViewer has problems with that.\n",width); rfbErr("WARNING: Width (%d) is not a multiple of 4. VncViewer has problems with that.\n",width);

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
VERSION="0.7.3" VERSION="0.8"
cd "$(dirname "$0")" cd "$(dirname "$0")"

File diff suppressed because it is too large Load Diff

@ -2,7 +2,7 @@
.TH X11VNC "1" "January 2006" "x11vnc " "User Commands" .TH X11VNC "1" "January 2006" "x11vnc " "User Commands"
.SH NAME .SH NAME
x11vnc - allow VNC connections to real X11 displays x11vnc - allow VNC connections to real X11 displays
version: 0.7.3, lastmod: 2006-01-10 version: 0.8, lastmod: 2006-01-11
.SH SYNOPSIS .SH SYNOPSIS
.B x11vnc .B x11vnc
[OPTION]... [OPTION]...

@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0; int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */ /* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.7.3 lastmod: 2006-01-10"; char lastmod[] = "0.8 lastmod: 2006-01-11";
/* X display info */ /* X display info */

Loading…
Cancel
Save