From 05c8f77dd9d441e588b8a3ec2547bb1874ac0914 Mon Sep 17 00:00:00 2001 From: pk910 Date: Sat, 1 Sep 2012 22:33:51 +0200 Subject: [PATCH] fixed "unused variable" and some timeq errors when not using threads on compile --- src/ClientSocket.c | 2 ++ src/timeq.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/ClientSocket.c b/src/ClientSocket.c index a1a5726..52316fd 100644 --- a/src/ClientSocket.c +++ b/src/ClientSocket.c @@ -217,7 +217,9 @@ int clientsocket_parseorder_top(unsigned int tid) { static IOHANDLER_CALLBACK(socket_callback) { struct ClientSocket *client = event->iofd->data; + #ifdef HAVE_THREADS unsigned int tid; + #endif switch(event->type) { case IOEVENT_CONNECTED: client->flags |= SOCKET_FLAG_CONNECTED; diff --git a/src/timeq.c b/src/timeq.c index 7689b31..b71bb75 100644 --- a/src/timeq.c +++ b/src/timeq.c @@ -49,10 +49,12 @@ struct timeq_entry* timeq_uadd(int useconds, int module_id, timeq_callback_t *ca perror("malloc() failed"); return NULL; } + #ifdef HAVE_THREADS if(!pthread_mutex_initialized) { THREAD_MUTEX_INIT(synchronized); pthread_mutex_initialized = 1; } + #endif gettimeofday(&timeout, NULL); SYNCHRONIZE(synchronized); timeout.tv_usec += (useconds % 1000); @@ -83,7 +85,9 @@ struct timeq_entry* timeq_uadd_name(char *name, int useconds, int module_id, tim } int timeq_del(struct timeq_entry* entry) { + #ifdef HAVE_THREADS if(!pthread_mutex_initialized) return 0; + #endif SYNCHRONIZE(synchronized); if(entry->next) entry->next->prev = entry->prev; -- 2.20.1