Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 48 lines 1.9 kB view raw
1diff --git a/src/libcrypto.cc b/src/libcrypto.cc 2index 5139f66..517103f 100644 3--- a/src/libcrypto.cc 4+++ b/src/libcrypto.cc 5@@ -100,17 +100,9 @@ int load_libcrypto() { 6 } 7 8 sdprintf("Loading libcrypto"); 9+ dlerror(); // Clear Errors 10+ libcrypto_handle = dlopen("@openssl@/lib/libcrypto.so", RTLD_LAZY|RTLD_GLOBAL); 11 12- bd::Array<bd::String> libs_list(bd::String("libcrypto.so." SHLIB_VERSION_NUMBER " libcrypto.so libcrypto.so.1.1 libcrypto.so.1.0.0 libcrypto.so.0.9.8 libcrypto.so.10 libcrypto.so.9 libcrypto.so.8 libcrypto.so.7 libcrypto.so.6").split(' ')); 13- 14- for (size_t i = 0; i < libs_list.length(); ++i) { 15- dlerror(); // Clear Errors 16- libcrypto_handle = dlopen(bd::String(libs_list[i]).c_str(), RTLD_LAZY|RTLD_GLOBAL); 17- if (libcrypto_handle) { 18- sdprintf("Found libcrypto: %s", bd::String(libs_list[i]).c_str()); 19- break; 20- } 21- } 22 if (!libcrypto_handle) { 23 fprintf(stderr, STR("Unable to find libcrypto\n")); 24 return(1); 25diff --git a/src/libssl.cc b/src/libssl.cc 26index 6010abc..86e29fc 100644 27--- a/src/libssl.cc 28+++ b/src/libssl.cc 29@@ -78,17 +78,9 @@ int load_libssl() { 30 } 31 32 sdprintf("Loading libssl"); 33+ dlerror(); // Clear Errors 34+ libssl_handle = dlopen("@openssl@/lib/libssl.so", RTLD_LAZY); 35 36- bd::Array<bd::String> libs_list(bd::String("libssl.so." SHLIB_VERSION_NUMBER " libssl.so libssl.so.1.1 libssl.so.1.0.0 libssl.so.0.9.8 libssl.so.10 libssl.so.9 libssl.so.8 libssl.so.7 libssl.so.6").split(' ')); 37- 38- for (size_t i = 0; i < libs_list.length(); ++i) { 39- dlerror(); // Clear Errors 40- libssl_handle = dlopen(bd::String(libs_list[i]).c_str(), RTLD_LAZY); 41- if (libssl_handle) { 42- sdprintf("Found libssl: %s", bd::String(libs_list[i]).c_str()); 43- break; 44- } 45- } 46 if (!libssl_handle) { 47 fprintf(stderr, STR("Unable to find libssl\n")); 48 return(1);