From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 7 Sep 2008 12:43:44 +0000 (+0000)
Subject: Move the LogPutString() call in log_error() into the locked
X-Git-Tag: v_3_0_11~250
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/%22https:/@user-manual@?a=commitdiff_plain;h=9c3c3f64e4bf11808e1e5bc6ada6ffc5c8707a72;p=privoxy.git

Move the LogPutString() call in log_error() into the locked
region so the Windows GUI log is consistent with the logfile.
---

diff --git a/errlog.c b/errlog.c
index 34bf3489..24062a2e 100644
--- a/errlog.c
+++ b/errlog.c
@@ -1,4 +1,4 @@
-const char errlog_rcs[] = "$Id: errlog.c,v 1.75 2008/09/04 08:13:58 fabiankeil Exp $";
+const char errlog_rcs[] = "$Id: errlog.c,v 1.76 2008/09/07 12:35:05 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/errlog.c,v $
@@ -33,6 +33,9 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.75 2008/09/04 08:13:58 fabiankeil E
  *
  * Revisions   :
  *    $Log: errlog.c,v $
+ *    Revision 1.76  2008/09/07 12:35:05  fabiankeil
+ *    Add mutex lock support for _WIN32.
+ *
  *    Revision 1.75  2008/09/04 08:13:58  fabiankeil
  *    Prepare for critical sections on Windows by adding a
  *    layer of indirection before the pthread mutex functions.
@@ -1246,13 +1249,14 @@ void log_error(int loglevel, const char *fmt, ...)
    {
       fputs(outbuf_save, logfp);
    }
-   unlock_logfile();
 
 #if defined(_WIN32) && !defined(_WIN_CONSOLE)
    /* Write to display */
    LogPutString(outbuf_save);
 #endif /* defined(_WIN32) && !defined(_WIN_CONSOLE) */
 
+   unlock_logfile();
+
 }