diff options
author | Stef Walter <stef@memberwebs.com> | 2004-09-04 00:16:11 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2004-09-04 00:16:11 +0000 |
commit | 028f34686603b2d981e782488b5e59ac74289279 (patch) | |
tree | 6fa2554f2ed82adcd4ea96014e6e5f3e85d45ede /common/stringx.c | |
parent | 557769cc1da3e633f00d2d80c368482e0501b5fd (diff) |
Make g_state a readonly pointer.
Diffstat (limited to 'common/stringx.c')
-rw-r--r-- | common/stringx.c | 14 |
1 files changed, 7 insertions, 7 deletions
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; |