From bd24feaa86f8154e550107990392ac9ac05e60d4 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 19 Oct 2012 11:23:39 +0200 Subject: Trace the use of GPG_ERR_INV_ENGINE. * src/debug.h: Include "gpgme.h" (_gpgme_trace_gpgme_error): New. (trace_gpg_error): New macro. Use it in all files where we return GPG_ERR_INV_ENGINE; also "include debug.h" as needed. -- This is a pretty common error code but often it is hard to figure out the actual cause. With debug level 4 we now print the file name and line number where this error code is generated by gpgme. Along with the git revision printed in the first log lines, this should give us an easier way to track down the problems related to this error code. --- src/engine-gpgconf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/engine-gpgconf.c') diff --git a/src/engine-gpgconf.c b/src/engine-gpgconf.c index 8de847cd..b50b6351 100644 --- a/src/engine-gpgconf.c +++ b/src/engine-gpgconf.c @@ -300,7 +300,7 @@ gpgconf_config_load_cb (void *hook, char *line) /* We require at least the first 3 fields. */ if (fields < 2) - return gpg_error (GPG_ERR_INV_ENGINE); + return trace_gpg_error (GPG_ERR_INV_ENGINE); /* Find the pointer to the new component in the list. */ while (comp && comp->next) @@ -426,7 +426,7 @@ gpgconf_config_load_cb2 (void *hook, char *line) /* We require at least the first 10 fields. */ if (fields < 10) - return gpg_error (GPG_ERR_INV_ENGINE); + return trace_gpg_error (GPG_ERR_INV_ENGINE); opt = calloc (1, sizeof (*opt)); if (!opt) -- cgit v1.2.3