test-nss: fix loading of modules under meson

There is no .libs dirs under meson. Just try both paths.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-04-14 19:49:15 -04:00
parent aac2605820
commit 3762b6722e
1 changed files with 5 additions and 3 deletions

View File

@ -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);