[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcrypt-devel
Subject:    Re: MinGW+Wine and "DBG: rndw32: get performance data problem: ec=2"
From:       Simon Josefsson <simon () josefsson ! org>
Date:       2008-01-17 20:33:38
Message-ID: 878x2oi44d.fsf () mocca ! josefsson ! org
[Download RAW message or body]

Simon Josefsson <simon@josefsson.org> writes:

> Simon Josefsson <simon@josefsson.org> writes:
>
>> Works for me.  How about this patch?
>
> I reversed the logic in the variable name, here is a better patch...

This patch is somewhat better -- if the return codes for some reason
differ between invocations, the code will print a new debug message
every time it changes.

(The first time, 'been_here' can never be ERROR_SUCCESS, or it wouldn't
have reached that if clause.)

/Simon

Index: rndw32.c
===================================================================
--- rndw32.c	(revision 1280)
+++ rndw32.c	(working copy)
@@ -1,5 +1,5 @@
 /* rndw32.c  -  W32 entropy gatherer
- * Copyright (C) 1999, 2000, 2002, 2003, 2007 Free Software Foundation, Inc.
+ * Copyright (C) 1999, 2000, 2002, 2003, 2007, 2008 Free Software Foundation, Inc.
  * Copyright Peter Gutmann, Matt Thomlinson and Blake Coverett 1996-2006
  *
  * This file is part of Libgcrypt.
@@ -440,8 +440,11 @@
         }
       else
         {
-          log_debug ("rndw32: get performance data problem: ec=%ld\n",
-                     status);
+	  static int been_here = ERROR_SUCCESS;
+	  if (been_here != status)
+	    log_debug ("rndw32: get performance data problem: ec=%ld\n",
+		       status);
+	  been_here = status;
           break;
         }
     }

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic