Browse Source

dlopen() doesnt actually set errno

git.mgm/mediaproxy-ng/github/master
Richard Fuchs 13 years ago
parent
commit
92e43e9aa8
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      daemon/main.c

+ 3
- 1
daemon/main.c View File

@ -3,6 +3,7 @@
#include <signal.h> #include <signal.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <glib.h> #include <glib.h>
#include <glib/gstdio.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
@ -452,7 +453,8 @@ void create_everything(struct main_context *ctx) {
if (redis_ip) { if (redis_ip) {
dlh = dlopen(MP_PLUGIN_DIR "/mediaproxy-redis.so", RTLD_NOW | RTLD_GLOBAL); dlh = dlopen(MP_PLUGIN_DIR "/mediaproxy-redis.so", RTLD_NOW | RTLD_GLOBAL);
if (!dlh && errno == ENOENT)
if (!dlh && !g_file_test(MP_PLUGIN_DIR "/mediaproxy-redis.so", G_FILE_TEST_IS_REGULAR)
&& g_file_test("../../mediaproxy-redis/redis.so", G_FILE_TEST_IS_REGULAR))
dlh = dlopen("../../mediaproxy-redis/redis.so", RTLD_NOW | RTLD_GLOBAL); dlh = dlopen("../../mediaproxy-redis/redis.so", RTLD_NOW | RTLD_GLOBAL);
if (!dlh) if (!dlh)
die("Failed to open redis plugin, aborting (%s)\n", dlerror()); die("Failed to open redis plugin, aborting (%s)\n", dlerror());


Loading…
Cancel
Save