From 9d026442b24a4c9602122a62fe0bd9c2eb572d88 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Wed, 8 Apr 2009 16:58:07 +0200 Subject: [PATCH] Remove alternate plugin load paths --- src/main.c | 39 +++++++++++---------------------------- 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/src/main.c b/src/main.c index 63018b6a..cf6c9032 100644 --- a/src/main.c +++ b/src/main.c @@ -398,7 +398,6 @@ int main(int argc, char *argv[]) { char *apppath; int debuglevel=0; - int plugins_loaded = 0; err_setlevel(2); @@ -527,37 +526,21 @@ int main(int argc, char *argv[]) { /* load plugins before we drop privs? Maybe... let the * plugins do stuff they might need to */ plugin_init(); - if((plugindir=conf_alloc_string("plugins","plugin_dir",NULL)) != NULL) { + + plugindir = conf_alloc_string("plugins", "plugin_dir", NULL); + if (plugindir) + { /* instead of specifying plugins, let's walk through the directory * and load each of them */ - if(!load_plugin_dir(plugindir)) { - DPRINTF(E_LOG,L_MAIN,"Warning: Could not load plugins\n"); - } else { - plugins_loaded = TRUE; - } + if (!load_plugin_dir(plugindir)) + DPRINTF(E_LOG, L_MAIN, "Warning: Could not load plugins\n"); + free(plugindir); - } + } - if(!plugins_loaded) { - if((!load_plugin_dir("/usr/lib/firefly/plugins")) && - (!load_plugin_dir("/usr/lib/mt-daapd/plugins")) && - (!load_plugin_dir("/lib/mt-daapd/plugins")) && - (!load_plugin_dir("/lib/mt-daapd/plugins")) && - (!load_plugin_dir("/usr/local/lib/mt-daapd/plugins")) && - (!load_plugin_dir("/usr/local/lib/mt-daapd/plugins")) && - (!load_plugin_dir("/opt/share/firefly/plugins")) && - (!load_plugin_dir("/opt/share/mt-daapd/plugins")) && - (!load_plugin_dir("/opt/lib/firefly/plugins")) && - (!load_plugin_dir("/opt/lib/mt-daapd/plugins")) && - (!load_plugin_dir("plugins/.libs"))) { - DPRINTF(E_FATAL,L_MAIN,"plugins/plugin_dir not specified\n"); - } - } - - phandle=NULL; - while((phandle=plugin_enum(phandle))) { - DPRINTF(E_LOG,L_MAIN,"Plugin loaded: %s\n",plugin_get_description(phandle)); - } + phandle = NULL; + while ((phandle = plugin_enum(phandle))) + DPRINTF(E_LOG, L_MAIN, "Plugin loaded: %s\n", plugin_get_description(phandle)); /* Block signals for all threads except the main one */ sigemptyset(&sigs);