Commits (4)
......@@ -99,7 +99,6 @@ typedef struct log_tag
static log_t loglist[LOG_MAXLOGS];
static int _get_log_id(void);
static void _release_log_id(int log_id);
static void _lock_logger(void);
static void _unlock_logger(void);
......@@ -443,7 +442,7 @@ void log_contents (int log_id, char **_contents, unsigned int *_len)
static void __vsnprintf(char *str, size_t size, const char *format, va_list ap) {
int in_block = 0;
int block_size = 0;
int block_len;
int block_len = 0;
int block_space = 0;
const char * arg;
char buf[80];
......@@ -614,15 +613,12 @@ void log_write(int log_id, unsigned priority, const char *cat, const char *func,
void log_write_direct(int log_id, const char *fmt, ...)
{
va_list ap;
time_t now;
char line[LOG_MAXLINELEN];
if (log_id < 0 || log_id >= LOG_MAXLOGS) return;
va_start(ap, fmt);
now = time(NULL);
_lock_logger();
__vsnprintf(line, LOG_MAXLINELEN, fmt, ap);
if (_log_open (log_id))
......@@ -659,17 +655,6 @@ static int _get_log_id(void)
return id;
}
static void _release_log_id(int log_id)
{
/* lock mutex */
_lock_logger();
loglist[log_id].in_use = 0;
/* unlock mutex */
_unlock_logger();
}
static void _lock_logger(void)
{
#ifndef _WIN32
......@@ -687,7 +672,3 @@ static void _unlock_logger(void)
LeaveCriticalSection(&_logger_mutex);
#endif
}
......@@ -750,9 +750,8 @@ void thread_library_unlock(void)
void thread_join(thread_type *thread)
{
void *ret;
int i;
i = pthread_join(thread->sys_thread, &ret);
pthread_join(thread->sys_thread, &ret);
_mutex_lock(&_threadtree_mutex);
avl_delete(_threadtree, thread, _free_thread);
_mutex_unlock(&_threadtree_mutex);
......