summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-03-27 23:39:10 +0000
committerLennart Poettering <lennart@poettering.net>2008-03-27 23:39:10 +0000
commitac820293389b195332ac072240bd0930cdb305ec (patch)
tree170a80ee72c11e15d8052e9cb1609108fc718592
parent95422a8d21115cdc78c816b2480b7ec048eb8f51 (diff)
merge r2132 from trunk
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/prepare-0.9.10@2175 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/daemon/daemon.conf.in2
-rwxr-xr-xsrc/daemon/default.pa.in6
-rw-r--r--src/pulsecore/cli-command.c32
3 files changed, 34 insertions, 6 deletions
diff --git a/src/daemon/daemon.conf.in b/src/daemon/daemon.conf.in
index d664962e..e4cfb82b 100644
--- a/src/daemon/daemon.conf.in
+++ b/src/daemon/daemon.conf.in
@@ -38,7 +38,7 @@
; module-idle-time = 20
; scache-idle-time = 20
-; dl-search-path = @PA_DLSEARCHPATH@
+; dl-search-path = (depends on architecture)
; default-script-file = @PA_DEFAULT_CONFIG_FILE@
diff --git a/src/daemon/default.pa.in b/src/daemon/default.pa.in
index 597993c4..56904f56 100755
--- a/src/daemon/default.pa.in
+++ b/src/daemon/default.pa.in
@@ -37,7 +37,7 @@ load-sample-lazy pulse-hotplug /usr/share/sounds/startup3.wav
#load-module module-pipe-sink
### Automatically load driver modules depending on the hardware available
-.ifexists @PA_DLSEARCHPATH@/module-hal-detect@PA_SOEXT@
+.ifexists module-hal-detect@PA_SOEXT@
load-module module-hal-detect
.else
### Alternatively use the static hardware detection module (for systems that
@@ -79,7 +79,7 @@ load-module module-suspend-on-idle
#load-module module-x11-bell sample=x11-bell
### Publish connection data in the X11 root window
-.ifexists @PA_DLSEARCHPATH@/module-x11-publish@PA_SOEXT@
+.ifexists module-x11-publish@PA_SOEXT@
load-module module-x11-publish
.endif
@@ -91,7 +91,7 @@ load-module module-x11-publish
### Load additional modules from GConf settings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
-.ifexists @PA_DLSEARCHPATH@/module-gconf@PA_SOEXT@
+.ifexists module-gconf@PA_SOEXT@
load-module module-gconf
.endif
diff --git a/src/pulsecore/cli-command.c b/src/pulsecore/cli-command.c
index 3110a271..423c3f2a 100644
--- a/src/pulsecore/cli-command.c
+++ b/src/pulsecore/cli-command.c
@@ -31,6 +31,7 @@
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
+#include <ltdl.h>
#include <pulse/xmalloc.h>
@@ -1315,8 +1316,35 @@ int pa_cli_command_execute_line_stateful(pa_core *c, const char *s, pa_strbuf *b
} else {
const char *filename = cs+l+strspn(cs+l, whitespace);
- *ifstate = access(filename, F_OK) == 0 ? IFSTATE_TRUE : IFSTATE_FALSE;
- pa_log_debug("Checking for existance of '%s': %s", filename, *ifstate == IFSTATE_TRUE ? "success" : "failure");
+ /* Search DL_SEARCH_PATH unless the filename is absolute */
+ if (filename[0] == PA_PATH_SEP_CHAR) {
+
+ *ifstate = access(filename, F_OK) == 0 ? IFSTATE_TRUE : IFSTATE_FALSE;
+ pa_log_debug("Checking for existance of '%s': %s", filename, *ifstate == IFSTATE_TRUE ? "success" : "failure");
+
+ } else {
+ const char *paths, *state = NULL;
+ char *p;
+
+ if (!(paths = lt_dlgetsearchpath()))
+ return -1;
+
+ while ((p = pa_split(paths, ":", &state))) {
+ char *pathname;
+
+ pathname = pa_sprintf_malloc("%s" PA_PATH_SEP "%s", p, filename);
+ pa_xfree(p);
+
+ *ifstate = access(pathname, F_OK) == 0 ? IFSTATE_TRUE : IFSTATE_FALSE;
+ pa_log_debug("Checking for existance of '%s': %s", pathname, *ifstate == IFSTATE_TRUE ? "success" : "failure");
+
+ pa_xfree(pathname);
+
+ if (*ifstate == IFSTATE_TRUE)
+ break;
+ }
+ }
+
}
} else {
pa_strbuf_printf(buf, "Invalid meta command: %s\n", cs);