mirror of git://git.gnupg.org/gnupg.git
* maperror.c (map_assuan_err_with_source): Oops, args were swapped.
* w32-pth.c (pth_init): Enable debugging depending on env var.
This commit is contained in:
parent
694037f2a5
commit
e73100a940
|
@ -437,14 +437,20 @@ main (int argc, char **argv )
|
||||||
/* Libgcrypt requires us to register the threading model first.
|
/* Libgcrypt requires us to register the threading model first.
|
||||||
Note that this will also do the pth_init. */
|
Note that this will also do the pth_init. */
|
||||||
#ifdef USE_GNU_PTH
|
#ifdef USE_GNU_PTH
|
||||||
|
#ifdef HAVE_W32_SYSTEM
|
||||||
|
/* For W32 we need pth. */
|
||||||
|
pth_init ();
|
||||||
|
#else
|
||||||
err = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth);
|
err = gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pth);
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
log_fatal ("can't register GNU Pth with Libgcrypt: %s\n",
|
log_fatal ("can't register GNU Pth with Libgcrypt: %s\n",
|
||||||
gpg_strerror (err));
|
gpg_strerror (err));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif /*USE_GNU_PTH*/
|
#endif /*USE_GNU_PTH*/
|
||||||
|
|
||||||
|
|
||||||
/* Check that the libraries are suitable. Do it here because
|
/* Check that the libraries are suitable. Do it here because
|
||||||
the option parsing may need services of the library. */
|
the option parsing may need services of the library. */
|
||||||
if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) )
|
if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) )
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2004-12-19 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* maperror.c (map_assuan_err_with_source): Oops, args were swapped.
|
||||||
|
|
||||||
2004-12-18 Werner Koch <wk@g10code.com>
|
2004-12-18 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* maperror.c (map_assuan_err): Renamed to ..
|
* maperror.c (map_assuan_err): Renamed to ..
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
simple: All errors with a gpg_err_source of UNKNOWN are genuine
|
simple: All errors with a gpg_err_source of UNKNOWN are genuine
|
||||||
Assuan codes all others are passed verbatim through. */
|
Assuan codes all others are passed verbatim through. */
|
||||||
gpg_error_t
|
gpg_error_t
|
||||||
map_assuan_err_with_source (int err, int source)
|
map_assuan_err_with_source (int source, int err)
|
||||||
{
|
{
|
||||||
gpg_err_code_t ec;
|
gpg_err_code_t ec;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2004-12-19 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* w32-pth.c (pth_init): Enable debugging depending on env var.
|
||||||
|
|
||||||
2004-12-18 Werner Koch <wk@g10code.com>
|
2004-12-18 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* w32-pth.c (pth_init): Reverse return values. Use TRUE and FALSE
|
* w32-pth.c (pth_init): Reverse return values. Use TRUE and FALSE
|
||||||
|
|
|
@ -40,6 +40,9 @@
|
||||||
#define W32_PTH_HANDLE_INTERNAL HANDLE
|
#define W32_PTH_HANDLE_INTERNAL HANDLE
|
||||||
#include "w32-pth.h"
|
#include "w32-pth.h"
|
||||||
|
|
||||||
|
#define DEBUG_ENTER_LEAVE 1 /* Set to 1 to enable full debugging. */
|
||||||
|
|
||||||
|
|
||||||
#ifndef FALSE
|
#ifndef FALSE
|
||||||
#define FALSE 0
|
#define FALSE 0
|
||||||
#endif
|
#endif
|
||||||
|
@ -51,12 +54,15 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* States whether trhis module has been initialized. */
|
||||||
|
static int pth_initialized;
|
||||||
|
|
||||||
static int pth_initialized = 0;
|
/* Controls whether debugging is enabled. */
|
||||||
|
static int debug_enter_leave;
|
||||||
|
|
||||||
/* Variables to support event handling. */
|
/* Variables to support event handling. */
|
||||||
static int pth_signo = 0;
|
static int pth_signo;
|
||||||
static HANDLE pth_signo_ev = NULL;
|
static HANDLE pth_signo_ev;
|
||||||
|
|
||||||
/* Mutex to make sure only one thread is running. */
|
/* Mutex to make sure only one thread is running. */
|
||||||
static CRITICAL_SECTION pth_shd;
|
static CRITICAL_SECTION pth_shd;
|
||||||
|
@ -124,6 +130,8 @@ pth_init (void)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
fprintf (stderr, "%s: pth_init: called.\n", log_get_prefix (NULL));
|
fprintf (stderr, "%s: pth_init: called.\n", log_get_prefix (NULL));
|
||||||
|
debug_enter_leave = !!getenv ("DEBUG_PTH");
|
||||||
|
|
||||||
if (WSAStartup (0x202, &wsadat))
|
if (WSAStartup (0x202, &wsadat))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
pth_signo = 0;
|
pth_signo = 0;
|
||||||
|
@ -177,8 +185,9 @@ enter_pth (const char *function)
|
||||||
{
|
{
|
||||||
/* Fixme: I am not sure whether the same thread my enter a critical
|
/* Fixme: I am not sure whether the same thread my enter a critical
|
||||||
section twice. */
|
section twice. */
|
||||||
/* fprintf (stderr, "%s: enter_pth (%s)\n",
|
if (debug_enter_leave)
|
||||||
log_get_prefix (NULL), function? function:""); */
|
fprintf (stderr, "%s: enter_pth (%s)\n",
|
||||||
|
log_get_prefix (NULL), function? function:"");
|
||||||
LeaveCriticalSection (&pth_shd);
|
LeaveCriticalSection (&pth_shd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,8 +196,9 @@ static void
|
||||||
leave_pth (const char *function)
|
leave_pth (const char *function)
|
||||||
{
|
{
|
||||||
EnterCriticalSection (&pth_shd);
|
EnterCriticalSection (&pth_shd);
|
||||||
/* fprintf (stderr, "%s: leave_pth (%s)\n",
|
if (debug_enter_leave)
|
||||||
log_get_prefix (NULL), function? function:""); */
|
fprintf (stderr, "%s: leave_pth (%s)\n",
|
||||||
|
log_get_prefix (NULL), function? function:"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -296,6 +306,8 @@ pth_write (int fd, const void * buffer, size_t size)
|
||||||
fprintf (stderr, "%s: pth_write(%d) failed in write: %s\n",
|
fprintf (stderr, "%s: pth_write(%d) failed in write: %s\n",
|
||||||
log_get_prefix (NULL), fd,
|
log_get_prefix (NULL), fd,
|
||||||
w32_strerror (strerr, sizeof strerr));
|
w32_strerror (strerr, sizeof strerr));
|
||||||
|
fprintf (stderr, "--> fd = %d, handle = %p, size = %lu\n",
|
||||||
|
fd, (HANDLE)fd, size);
|
||||||
n = -1;
|
n = -1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1149,8 +1149,8 @@ list_internal_keys (ctrl_t ctrl, STRLIST names, FILE *fp,
|
||||||
char *p = gpgsm_get_keygrip_hexstring (cert);
|
char *p = gpgsm_get_keygrip_hexstring (cert);
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
rc = gpgsm_agent_havekey (ctrl, p);
|
rc = gpgsm_agent_havekey (ctrl, p);
|
||||||
if (!rc)
|
if (!rc)
|
||||||
have_secret = 1;
|
have_secret = 1;
|
||||||
else if ( gpg_err_code (rc) != GPG_ERR_NO_SECKEY)
|
else if ( gpg_err_code (rc) != GPG_ERR_NO_SECKEY)
|
||||||
goto leave;
|
goto leave;
|
||||||
|
|
Loading…
Reference in New Issue