From 028f34686603b2d981e782488b5e59ac74289279 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 4 Sep 2004 00:16:11 +0000 Subject: Make g_state a readonly pointer. --- common/stringx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'common/stringx.c') diff --git a/common/stringx.c b/common/stringx.c index c0a46bc..96c631b 100644 --- a/common/stringx.c +++ b/common/stringx.c @@ -67,14 +67,14 @@ static void vmessage(clamsmtp_context_t* ctx, int level, int err, char* m; int e = errno; - if(g_state.daemonized) + if(g_state->daemonized) { if(level >= LOG_DEBUG) return; } else { - if(g_state.debug_level < level) + if(g_state->debug_level < level) return; } @@ -102,7 +102,7 @@ static void vmessage(clamsmtp_context_t* ctx, int level, int err, } /* Either to syslog or stderr */ - if(g_state.daemonized) + if(g_state->daemonized) vsyslog(level, msg, ap); else vwarnx(msg, ap); @@ -244,16 +244,16 @@ void plock() #endif #ifdef _DEBUG - r = pthread_mutex_trylock(&(g_state.mutex)); + r = pthread_mutex_trylock(&(g_state->mutex)); if(r == EBUSY) { wait = 1; message(NULL, LOG_DEBUG, "thread will block: %d", pthread_self()); - r = pthread_mutex_lock(&(g_state.mutex)); + r = pthread_mutex_lock(&(g_state->mutex)); } #else - r = pthread_mutex_lock(&(g_state.mutex)); + r = pthread_mutex_lock(&(g_state->mutex)); #endif @@ -273,7 +273,7 @@ void plock() void punlock() { - int r = pthread_mutex_unlock(&(g_state.mutex)); + int r = pthread_mutex_unlock(&(g_state->mutex)); if(r != 0) { errno = r; -- cgit v1.2.3