gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r4719 - GNUnet/src/util/error


From: gnunet
Subject: [GNUnet-SVN] r4719 - GNUnet/src/util/error
Date: Mon, 26 Mar 2007 11:57:27 -0600 (MDT)

Author: durner
Date: 2007-03-26 11:57:27 -0600 (Mon, 26 Mar 2007)
New Revision: 4719

Modified:
   GNUnet/src/util/error/error.c
Log:
improve error reporting

Modified: GNUnet/src/util/error/error.c
===================================================================
--- GNUnet/src/util/error/error.c       2007-03-25 21:29:49 UTC (rev 4718)
+++ GNUnet/src/util/error/error.c       2007-03-26 17:57:27 UTC (rev 4719)
@@ -66,19 +66,14 @@
   struct tm * tmptr;
   size_t size;
   char * buf;
+#ifdef WINDOWS
+  int alloc_console = NO;
+#endif
 
   if (ctx == NULL) {
     ctx = defaultContext;
 #ifdef WINDOWS
-    /* Most tools disband the console window early in the initialization
-       process, so we have to create a new one if we're logging to the
-       default context. */
-    if (AllocConsole()) {
-      if (ctx)
-        ctx->handler(ctx->cls, kind, date, _("Error log:"));
-      else
-        fprintf(stderr, "%s\n", _("Error log:"));
-    }
+    alloc_console = YES;
 #endif
   }
   if ( (ctx != NULL)  &&
@@ -88,6 +83,19 @@
        ( ((kind & (GE_IMMEDIATE | GE_BULK)) == 0) ||
         ((kind & (GE_FATAL | GE_ERROR | GE_WARNING)) == 0) ) )
     return;
+    
+#ifdef WINDOWS
+    /* Most tools disband the console window early in the initialization
+       process, so we have to create a new one if we're logging to the
+       default context. */
+    if (alloc_console && AllocConsole()) {
+      if (ctx)
+        ctx->handler(ctx->cls, kind, date, _("Error log:\n"));
+      else
+        fprintf(stderr, "%s", _("Error log:\n"));
+    }
+#endif
+    
   va_start(va, message);
   size = VSNPRINTF(NULL, 0, message, va) + 1;
   va_end(va);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]