diff options
author | runge <runge> | 2006-01-11 19:56:10 +0000 |
---|---|---|
committer | runge <runge> | 2006-01-11 19:56:10 +0000 |
commit | 9b3163c00bdb8d406b864f7a1282b5770d953425 (patch) | |
tree | 36e01c6883c99d01e3e6974a7b7a674ed0d94696 /libvncserver/main.c | |
parent | 57cf0cdab5480efebaf447d5675e51b0d311ceee (diff) | |
download | libtdevnc-9b3163c00bdb8d406b864f7a1282b5770d953425.tar.gz libtdevnc-9b3163c00bdb8d406b864f7a1282b5770d953425.zip |
logMutex needs to be initialized too; in rfbDefaultLog.
Diffstat (limited to 'libvncserver/main.c')
-rw-r--r-- | libvncserver/main.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libvncserver/main.c b/libvncserver/main.c index 51f9f2f..00b71be 100644 --- a/libvncserver/main.c +++ b/libvncserver/main.c @@ -38,6 +38,8 @@ #include <signal.h> #include <time.h> +static int extMutex_initialized = 0; +static int logMutex_initialized = 0; #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD static MUTEX(logMutex); static MUTEX(extMutex); @@ -61,7 +63,6 @@ void rfbRegisterProtocolExtension(rfbProtocolExtension* extension) { rfbProtocolExtension* last; - static int extMutex_initialized = 0; if (! extMutex_initialized) { INIT_MUTEX(extMutex); @@ -152,6 +153,11 @@ rfbDefaultLog(const char *format, ...) if(!rfbEnableLogging) return; + if (! logMutex_initialized) { + INIT_MUTEX(logMutex); + logMutex_initialized = 1; + } + LOCK(logMutex); va_start(args, format); @@ -654,7 +660,11 @@ rfbScreenInfoPtr rfbGetScreen(int* argc,char** argv, { rfbScreenInfoPtr screen=calloc(sizeof(rfbScreenInfo),1); - INIT_MUTEX(logMutex); + if (! logMutex_initialized) { + INIT_MUTEX(logMutex); + logMutex_initialized = 1; + } + if(width&3) rfbErr("WARNING: Width (%d) is not a multiple of 4. VncViewer has problems with that.\n",width); |