Mercurial > gftp.yaz
diff src/gtk/misc-gtk.c @ 190:876747813a60
2003-6-17 Brian Masney <masneyb@gftp.org>
* src/gtk/misc-gtk.c (ftp_log) - remote charset fixes for when the log
message is generated inside a child thread
* lib/cache.c - don't complain about not being able to open index.db
author | masneyb |
---|---|
date | Wed, 18 Jun 2003 01:07:51 +0000 |
parents | 13ca1defdc75 |
children | 3fa7b4f4ab78 |
line wrap: on
line diff
--- a/src/gtk/misc-gtk.c Tue Jun 17 14:18:05 2003 +0000 +++ b/src/gtk/misc-gtk.c Wed Jun 18 01:07:51 2003 +0000 @@ -56,20 +56,6 @@ const char *descr; #endif - if (pthread_self () != main_thread_id) - { - newlog = g_malloc0 (sizeof (*newlog)); - newlog->type = level; - va_start (argp, string); - newlog->msg = g_strdup_vprintf (string, argp); - va_end (argp); - - pthread_mutex_lock (&log_mutex); - gftp_file_transfer_logs = g_list_append (gftp_file_transfer_logs, newlog); - pthread_mutex_unlock (&log_mutex); - return; - } - va_start (argp, string); if (strcmp (string, "%s") == 0) { @@ -98,6 +84,21 @@ } #endif + if (pthread_self () != main_thread_id) + { + newlog = g_malloc0 (sizeof (*newlog)); + newlog->type = level; + if (free_logstr) + newlog->msg = logstr; + else + newlog->msg = g_strdup (logstr); + + pthread_mutex_lock (&log_mutex); + gftp_file_transfer_logs = g_list_append (gftp_file_transfer_logs, newlog); + pthread_mutex_unlock (&log_mutex); + return; + } + if (gftp_logfd != NULL) { if (fwrite (logstr, strlen (logstr), 1, gftp_logfd) != 1)