From f6e2f11299cf3b0efbc55509a09b73fba3440b19 Mon Sep 17 00:00:00 2001 From: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Date: Sat, 10 Sep 2022 23:02:37 +0100 Subject: [PATCH] nix: patch to replace ERR_error_string with ERR_func_error_string --- flake.nix | 1 + scripts/nix/direct-sqlcipher-err-string.patch | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 scripts/nix/direct-sqlcipher-err-string.patch diff --git a/flake.nix b/flake.nix index 056735f4a4..0427d1ce7b 100644 --- a/flake.nix +++ b/flake.nix @@ -28,6 +28,7 @@ packages.direct-sqlcipher.patches = [ ./scripts/nix/direct-sqlcipher-2.3.27.patch ./scripts/nix/direct-sqlcipher-android.patch + ./scripts/nix/direct-sqlcipher-err-string.patch ]; packages.entropy.patches = [ ./scripts/nix/entropy.patch ]; } diff --git a/scripts/nix/direct-sqlcipher-err-string.patch b/scripts/nix/direct-sqlcipher-err-string.patch new file mode 100644 index 0000000000..c12c729acb --- /dev/null +++ b/scripts/nix/direct-sqlcipher-err-string.patch @@ -0,0 +1,12 @@ +diff --git a/cbits/sqlite3.c b/cbits/sqlite3.c +index 66bb609..ca32723 100644 +--- a/cbits/sqlite3.c ++++ b/cbits/sqlite3.c +@@ -105731,7 +105731,7 @@ static unsigned int openssl_init_count = 0; + static void sqlcipher_openssl_log_errors() { + unsigned long err = 0; + while((err = ERR_get_error()) != 0) { +- sqlcipher_log(SQLCIPHER_LOG_ERROR, "sqlcipher_openssl_log_errors: ERR_get_error() returned %lx: %s", err, ERR_error_string(err, NULL)); ++ sqlcipher_log(SQLCIPHER_LOG_ERROR, "sqlcipher_openssl_log_errors: ERR_get_error() returned %lx: %s", err, ERR_func_error_string(err)); + } + }