From f9bfb0c509fa622d0a2bdc8e340c069c820e99fe Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Sat, 14 Feb 2009 21:26:30 +0000 Subject: [PATCH] MODLANG-99 Work around broken uClibc git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12014 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_dso.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/switch_dso.c b/src/switch_dso.c index 8d5b965419..259bf1fc23 100644 --- a/src/switch_dso.c +++ b/src/switch_dso.c @@ -97,7 +97,13 @@ switch_dso_lib_t switch_dso_open(const char *path, int global, char **err) { } if (lib == NULL) { - *err = strdup(dlerror()); + const char *dlerr = dlerror(); + /* Work around broken uclibc returning NULL on both dlopen() and dlerror() */ + if (dlerr) { + *err = strdup(dlerr); + } else { + *err = strdup("Unknown error"); + } } return lib; }