From 92e43e9aa8ba55505d4f3e9e2d147a6d1d92e725 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 2 Jul 2013 14:46:28 -0400 Subject: [PATCH] dlopen() doesnt actually set errno --- daemon/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/main.c b/daemon/main.c index 47abd60e6..3098c37cc 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -452,7 +453,8 @@ void create_everything(struct main_context *ctx) { if (redis_ip) { 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); if (!dlh) die("Failed to open redis plugin, aborting (%s)\n", dlerror());