summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMaarten Bosmans <mkbosmans@gmail.com>2011-03-22 16:02:23 +0100
committerColin Guthrie <cguthrie@mandriva.org>2011-03-24 09:11:30 +0000
commit72323bc6bb3486feaefcfe41cd39c08705393a8b (patch)
tree71ae1772dc1b3ddcef4ccffdbc5eb900df7fcac3 /src
parentae35ec1ed5f76aab6a0a60a27adf1d6b92323e70 (diff)
win32: Simplify dl_search_path code
And add #include <sys/stat.h>, needed by the code introduced in f7acd4bd.
Diffstat (limited to 'src')
-rw-r--r--src/daemon/daemon-conf.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
index 9b530a80..59579d92 100644
--- a/src/daemon/daemon-conf.c
+++ b/src/daemon/daemon-conf.c
@@ -29,6 +29,7 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
+#include <sys/stat.h>
#ifdef HAVE_SCHED_H
#include <sched.h>
@@ -37,6 +38,7 @@
#include <pulse/xmalloc.h>
#include <pulse/timeval.h>
#include <pulse/i18n.h>
+#include <pulse/version.h>
#include <pulsecore/core-error.h>
#include <pulsecore/core-util.h>
@@ -147,6 +149,10 @@ pa_daemon_conf* pa_daemon_conf_new(void) {
c = pa_xnewdup(pa_daemon_conf, &default_conf, 1);
+#ifdef OS_IS_WIN32
+ c->dl_search_path = pa_sprintf_malloc("%s" PA_PATH_SEP "lib" PA_PATH_SEP "pulse-%d.%d" PA_PATH_SEP "modules",
+ pa_win32_get_toplevel(NULL), PA_MAJOR, PA_MINOR);
+#else
#if defined(__linux__) && !defined(__OPTIMIZE__)
/* We abuse __OPTIMIZE__ as a check whether we are a debug build
@@ -160,19 +166,6 @@ pa_daemon_conf* pa_daemon_conf_new(void) {
} else
#endif
-#ifdef OS_IS_WIN32
- {
- char *t;
- char *majorminor = pa_xstrdup(VERSION);
- char *toplevel = pa_win32_get_toplevel(NULL);
-
- if ((t = strchr(majorminor, '-')))
- *t = '\0';
-
- c->dl_search_path = pa_sprintf_malloc("%s" PA_PATH_SEP "lib" PA_PATH_SEP "pulse-%s" PA_PATH_SEP "modules", toplevel, majorminor);
- pa_xfree(majorminor);
- }
-#else
c->dl_search_path = pa_xstrdup(PA_DLSEARCHPATH);
#endif