From ea0a7618b18439f151541bda9183f8da0fafe1dc Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 14 Oct 2016 03:40:24 -0400 Subject: [PATCH] Turned some error output back on. --- lx_loader.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lx_loader.c b/lx_loader.c index 65a1ae2..a9a6ed8 100644 --- a/lx_loader.c +++ b/lx_loader.c @@ -1141,7 +1141,7 @@ static LxModule *loadLxModuleByPathInternal(const char *fname, const int depende return retval; loadmod_failed: - //fprintf(stderr, "%s failure on '%s: %s'\n", what, fname, strerror(errno)); + fprintf(stderr, "%s failure on '%s: %s'\n", what, fname, strerror(errno)); if (io) fclose(io); free(module); @@ -1214,7 +1214,11 @@ static LxModule *loadLxModuleByModuleNameInternal(const char *modname, const int // !!! FIXME: decide the right path to the file, or if it's a native replacement library. char fname[256]; snprintf(fname, sizeof (fname), "%s.dll", modname); - LxModule *retval = loadLxModuleByPathInternal(fname, dependency_tree_depth); + + LxModule *retval = NULL; + if (access(fname, F_OK) == 0) + retval = loadLxModuleByPathInternal(fname, dependency_tree_depth); + if (!retval) { snprintf(fname, sizeof (fname), "./lib%s.so", modname); for (char *ptr = fname; *ptr; ptr++) {