changeset 21482:d7227df3624d

lib-dcrypt: If dcrypt can't be initialized, log also the reason. This is very helpful when debugging linking issues.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sun, 05 Feb 2017 20:20:37 +0200
parents 0f676a75b649
children 7b0b2790d988
files src/lib-dcrypt/test-crypto.c src/lib-dcrypt/test-stream.c
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-dcrypt/test-crypto.c	Sun Feb 05 21:38:33 2017 +0200
+++ b/src/lib-dcrypt/test-crypto.c	Sun Feb 05 20:20:37 2017 +0200
@@ -755,10 +755,11 @@
 	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;
 	}
 
--- a/src/lib-dcrypt/test-stream.c	Sun Feb 05 21:38:33 2017 +0200
+++ b/src/lib-dcrypt/test-stream.c	Sun Feb 05 20:20:37 2017 +0200
@@ -527,9 +527,10 @@
 	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();