diff options
author | Werner Koch <[email protected]> | 2012-10-19 09:23:39 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2012-10-19 09:23:39 +0000 |
commit | bd24feaa86f8154e550107990392ac9ac05e60d4 (patch) | |
tree | 6774aa2c1148896839045d2f34e753d0def5d050 /src/engine.c | |
parent | Avoid warning about initialized but not used variable (diff) | |
download | gpgme-bd24feaa86f8154e550107990392ac9ac05e60d4.tar.gz gpgme-bd24feaa86f8154e550107990392ac9ac05e60d4.zip |
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.
Diffstat (limited to 'src/engine.c')
-rw-r--r-- | src/engine.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/engine.c b/src/engine.c index 17d8d870..f72ce7f9 100644 --- a/src/engine.c +++ b/src/engine.c @@ -30,6 +30,7 @@ #include "util.h" #include "sema.h" #include "ops.h" +#include "debug.h" #include "engine.h" #include "engine-backend.h" @@ -166,7 +167,7 @@ gpgme_engine_check_version (gpgme_protocol_t proto) info->req_version); UNLOCK (engine_info_lock); - return result ? 0 : gpg_error (GPG_ERR_INV_ENGINE); + return result ? 0 : trace_gpg_error (GPG_ERR_INV_ENGINE); } @@ -359,7 +360,7 @@ _gpgme_set_engine_info (gpgme_engine_info_t info, gpgme_protocol_t proto, info = info->next; if (!info) - return gpg_error (GPG_ERR_INV_ENGINE); + return trace_gpg_error (GPG_ERR_INV_ENGINE); /* Prepare new members. */ if (file_name) @@ -449,7 +450,7 @@ _gpgme_engine_new (gpgme_engine_info_t info, engine_t *r_engine) engine_t engine; if (!info->file_name || !info->version) - return gpg_error (GPG_ERR_INV_ENGINE); + return trace_gpg_error (GPG_ERR_INV_ENGINE); engine = calloc (1, sizeof *engine); if (!engine) |