diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/asshelp.c | 15 | ||||
-rw-r--r-- | common/asshelp.h | 2 |
2 files changed, 17 insertions, 0 deletions
diff --git a/common/asshelp.c b/common/asshelp.c index 6706154cd..0152d1243 100644 --- a/common/asshelp.c +++ b/common/asshelp.c @@ -128,6 +128,21 @@ set_libassuan_log_cats (unsigned int newcats) } +/* Get the last Windows error from an Assuan socket function and print + * the raw error code using log_info. */ +void +log_libassuan_system_error (assuan_fd_t fd) +{ + int w32err = 0; + + if (assuan_sock_get_flag (fd, "w32_error", &w32err)) + w32err = -1; /* Old Libassuan or not Windows. */ + + if (w32err != -1) + log_info ("system error code: %d (0x%x)\n", w32err, w32err); +} + + static gpg_error_t send_one_option (assuan_context_t ctx, gpg_err_source_t errsource, diff --git a/common/asshelp.h b/common/asshelp.h index bca50759d..cde6e226f 100644 --- a/common/asshelp.h +++ b/common/asshelp.h @@ -46,6 +46,8 @@ void setup_libassuan_logging (unsigned int *debug_var_address, const char *msg)); void set_libassuan_log_cats (unsigned int newcats); +void log_libassuan_system_error (assuan_fd_t fd); + gpg_error_t send_pinentry_environment (assuan_context_t ctx, |