summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/cli-command.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-03-27 20:52:59 +0000
committerLennart Poettering <lennart@poettering.net>2008-03-27 20:52:59 +0000
commita25a459cdf831a961bcbfa99ffa45154cc644e30 (patch)
treebccbc4bccb51cd209a30602ceb35d14a92c3e3dd /src/pulsecore/cli-command.c
parent7ad0b640aa6f6882e76fb5e5ae790bb47b9a0d98 (diff)
Attempt to resolve the multilib conflicts by getting all the config files
look equally for all plattforms. This includes getting rid go pathnames with libdir; let's make ps search for files with relative paths there. https://bugzilla.redhat.com/show_bug.cgi?id=228383 Modified patch, originally from Lubomir Kundrak <lkundrak@redhat.com> git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2132 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/pulsecore/cli-command.c')
-rw-r--r--src/pulsecore/cli-command.c32
1 files changed, 30 insertions, 2 deletions
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);