X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Fdebug.c;h=d3c13404ddd2e91ddbe2298ca079cb61c057606e;hb=96f35b20267e8b1a1c846d476f27fcd330e0b018;hp=dff138337fb66c36df5b8f3618a8ad6a6136ae60;hpb=d74dc4d908fcbc1a4ef474edaf51e61ec90eab6b;p=debian%2Famanda diff --git a/common-src/debug.c b/common-src/debug.c index dff1383..d3c1340 100644 --- a/common-src/debug.c +++ b/common-src/debug.c @@ -692,7 +692,6 @@ printf_arglist_function(void debug_printf, const char *, format) { va_list argp; int save_errno; - static GStaticMutex mutex = G_STATIC_MUTEX_INIT; /* * It is common in the code to call dbprintf to write out @@ -708,16 +707,20 @@ printf_arglist_function(void debug_printf, const char *, format) db_file = stderr; } if(db_file != NULL) { - g_static_mutex_lock(&mutex); + char *prefix; + char *text; + if (db_file != stderr) - g_fprintf(db_file, "%s: %s: ", msg_timestamp(), get_pname()); + prefix = g_strdup_printf("%s: %s:", msg_timestamp(), get_pname()); else - g_fprintf(db_file, "%s: ", get_pname()); + prefix = g_strdup_printf("%s:", get_pname()); arglist_start(argp, format); - g_vfprintf(db_file, format, argp); + text = g_strdup_vprintf(format, argp); arglist_end(argp); + fprintf(db_file, "%s %s", prefix, text); + amfree(prefix); + amfree(text); fflush(db_file); - g_static_mutex_unlock(&mutex); } errno = save_errno; }