/* Log */
void tvhlogv ( const char *file, int line,
int notify, int severity,
- const char *subsys, const char *fmt, va_list args )
+ const char *subsys, const char *fmt, va_list *args )
{
struct timeval now;
struct tm tm;
if (options & TVHLOG_OPT_FILELINE && severity >= LOG_DEBUG)
l += snprintf(buf + l, sizeof(buf) - l, "(%s:%d) ", file, line);
if (args)
- l += vsnprintf(buf + l, sizeof(buf) - l, fmt, args);
+ l += vsnprintf(buf + l, sizeof(buf) - l, fmt, *args);
else
l += snprintf(buf + l, sizeof(buf) - l, "%s", fmt);
const char *subsys, const char *fmt, ... )
{
va_list args;
- //pthread_mutex_lock(&tvhlog_mutex);
va_start(args, fmt);
- tvhlogv(file, line, notify, severity, subsys, fmt, args);
+ tvhlogv(file, line, notify, severity, subsys, fmt, &args);
va_end(args);
- //pthread_mutex_unlock(&tvhlog_mutex);
}
/*
int i, c;
char str[1024];
- //pthread_mutex_lock(&tvhlog_mutex);
while (len > 0) {
c = 0;
for (i = 0; i < HEXDUMP_WIDTH; i++) {
len -= HEXDUMP_WIDTH;
data += HEXDUMP_WIDTH;
}
- //pthread_mutex_unlock(&tvhlog_mutex);
}
void tvhlog_get_subsys ( char *subsys, size_t len );
void tvhlogv ( const char *file, int line,
int notify, int severity,
- const char *subsys, const char *fmt, va_list args );
+ const char *subsys, const char *fmt, va_list *args );
void _tvhlog ( const char *file, int line,
int notify, int severity,
const char *subsys, const char *fmt, ... )