From: Timo Sirainen Date: Sun, 5 Feb 2017 18:20:37 +0000 (+0200) Subject: lib-dcrypt: If dcrypt can't be initialized, log also the reason. X-Git-Tag: 2.3.0.rc1~2180 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5fc85eac8aa8b5663e62e3321c6617c27d670630;p=thirdparty%2Fdovecot%2Fcore.git lib-dcrypt: If dcrypt can't be initialized, log also the reason. This is very helpful when debugging linking issues. --- diff --git a/src/lib-dcrypt/test-crypto.c b/src/lib-dcrypt/test-crypto.c index eb76b5aaaf..40e290dc90 100644 --- a/src/lib-dcrypt/test-crypto.c +++ b/src/lib-dcrypt/test-crypto.c @@ -755,10 +755,11 @@ int main(void) { struct dcrypt_settings set = { .module_dir = ".libs" }; + const char *error; random_init(); - if (!dcrypt_initialize(NULL, &set, NULL)) { - i_error("No functional dcrypt backend found - skipping tests"); + if (!dcrypt_initialize(NULL, &set, &error)) { + i_error("No functional dcrypt backend found - skipping tests: %s", error); return 0; } diff --git a/src/lib-dcrypt/test-stream.c b/src/lib-dcrypt/test-stream.c index 99a5744bc5..a39602cfce 100644 --- a/src/lib-dcrypt/test-stream.c +++ b/src/lib-dcrypt/test-stream.c @@ -527,9 +527,10 @@ int main(void) { struct dcrypt_settings set = { .module_dir = ".libs" }; + const char *error; - if (!dcrypt_initialize(NULL, &set, NULL)) { - i_error("No functional dcrypt backend found - skipping tests"); + if (!dcrypt_initialize(NULL, &set, &error)) { + i_error("No functional dcrypt backend found - skipping tests: %s", error); return 0; } random_init();