summaryrefslogtreecommitdiffstats
path: root/lib/socket_wrapper/socket_wrapper.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/socket_wrapper/socket_wrapper.c')
-rw-r--r--lib/socket_wrapper/socket_wrapper.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/socket_wrapper/socket_wrapper.c b/lib/socket_wrapper/socket_wrapper.c
index 95643aa7bd..38f7a449f9 100644
--- a/lib/socket_wrapper/socket_wrapper.c
+++ b/lib/socket_wrapper/socket_wrapper.c
@@ -73,6 +73,9 @@
#include <stdarg.h>
#include <stdbool.h>
#include <unistd.h>
+#ifdef HAVE_GNU_LIB_NAMES_H
+#include <gnu/lib-names.h>
+#endif
enum swrap_dbglvl_e {
SWRAP_LOG_ERROR = 0,
@@ -418,6 +421,11 @@ static void *swrap_load_lib_handle(enum swrap_lib lib)
/* FALL TROUGH */
case SWRAP_LIBC:
handle = swrap.libc_handle;
+#ifdef LIBC_SO
+ if (handle == NULL) {
+ handle = dlopen(LIBC_SO, flags);
+ }
+#endif
if (handle == NULL) {
for (handle = NULL, i = 10; handle == NULL && i >= 0; i--) {
char soname[256] = {0};