Fix agent/call-pinentry.c (master)

NIIBE Yutaka gniibe at
Fri Jan 25 06:25:02 CET 2013


I found a minor bug in agent/call-pinentry.c (master branch).

pth_join returns TRUE (1) on success.  But npth_join (and pthread_join)
returns 0 on success, and error number on error.

I grep through the source code of GnuPG for npth_join, and this is the
only part where fix is needed.

I will commit&push to master.

diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c
index c37831a..c6b6b52 100644
--- a/agent/call-pinentry.c
+++ b/agent/call-pinentry.c
@@ -1266,9 +1266,9 @@ agent_popup_message_stop (ctrl_t ctrl)
   /* Now wait for the thread to terminate. */
   rc = npth_join (popup_tid, NULL);
-  if (!rc)
+  if (rc)
     log_debug ("agent_popup_message_stop: pth_join failed: %s\n",
-               strerror (errno));
+               strerror (rc));
   /* Thread IDs are opaque, but we try our best here by resetting it
      to the same content that a static global variable has.  */
   memset (&popup_tid, '\0', sizeof (popup_tid));

More information about the Gnupg-devel mailing list