summaryrefslogtreecommitdiff
path: root/src/test/test-nss.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test-nss.c')
-rw-r--r--src/test/test-nss.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/test/test-nss.c b/src/test/test-nss.c
index b59cb7aa69..b4cb3f0d37 100644
--- a/src/test/test-nss.c
+++ b/src/test/test-nss.c
@@ -71,9 +71,11 @@ static void* open_handle(const char* dir, const char* module, int flags) {
const char *path;
void *handle;
- if (dir)
- path = strjoina(dir, "/.libs/libnss_", module, ".so.2");
- else
+ if (dir) {
+ path = strjoina(dir, "/libnss_", module, ".so.2");
+ if (access(path, F_OK) < 0)
+ path = strjoina(dir, "/.libs/libnss_", module, ".so.2");
+ } else
path = strjoina("libnss_", module, ".so.2");
handle = dlopen(path, flags);