diff options
author | Lennart Poettering <lennart@poettering.net> | 2007-08-09 16:27:24 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2007-08-09 16:27:24 +0000 |
commit | eaddc0195cf12fa76430d843026188dda6d27aaf (patch) | |
tree | 5fbebecaa035830eab01ed902121b53c7e4e3da1 /src/modules/module-protocol-stub.c | |
parent | 33cd5e26cf8f7d43902b76172d8027f347e682cb (diff) |
by default, store esd socket in /tmp/.esd-`id -u`/socket, instead of /tmp/.esd/socket, to allow multiple simultaneous esd instances. this is only compatible with a patched esd, which however ubuntu and fedora ship now. other distros need to patch their esd as well, or may pass socket=/tmp/.esd/socket to module-protocol-esound-unix
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1598 fefdeb5f-60dc-0310-8127-8f9354f1896f
Diffstat (limited to 'src/modules/module-protocol-stub.c')
-rw-r--r-- | src/modules/module-protocol-stub.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/modules/module-protocol-stub.c b/src/modules/module-protocol-stub.c index 5c8733fb..3edb59e5 100644 --- a/src/modules/module-protocol-stub.c +++ b/src/modules/module-protocol-stub.c @@ -154,7 +154,6 @@ #define protocol_free pa_protocol_esound_free #define TCPWRAP_SERVICE "esound" #define IPV4_PORT ESD_DEFAULT_PORT - #define UNIX_SOCKET ESD_UNIX_SOCKET_NAME #define MODULE_ARGUMENTS_COMMON "sink", "source", "auth-anonymous", "cookie", #ifdef USE_TCP_SOCKETS #include "module-esound-protocol-tcp-symdef.h" @@ -219,6 +218,10 @@ int pa__init(pa_core *c, pa_module*m) { pa_socket_server *s; int r; char tmp[PATH_MAX]; + +#if defined(USE_PROTOCOL_ESOUND) + char tmp2[PATH_MAX]; +#endif #endif assert(c && m); @@ -262,11 +265,12 @@ int pa__init(pa_core *c, pa_module*m) { #else - pa_runtime_path(pa_modargs_get_value(ma, "socket", UNIX_SOCKET), tmp, sizeof(tmp)); - u->socket_path = pa_xstrdup(tmp); - #if defined(USE_PROTOCOL_ESOUND) + snprintf(tmp2, sizeof(tmp2), "/tmp/.esd-%lu/socket", (unsigned long) getuid()); + pa_runtime_path(pa_modargs_get_value(ma, "socket", tmp2), tmp, sizeof(tmp)); + u->socket_path = pa_xstrdup(tmp); + /* This socket doesn't reside in our own runtime dir but in * /tmp/.esd/, hence we have to create the dir first */ @@ -274,6 +278,10 @@ int pa__init(pa_core *c, pa_module*m) { pa_log("Failed to create socket directory '%s': %s\n", u->socket_path, pa_cstrerror(errno)); goto fail; } + +#else + pa_runtime_path(pa_modargs_get_value(ma, "socket", UNIX_SOCKET), tmp, sizeof(tmp)); + u->socket_path = pa_xstrdup(tmp); #endif if ((r = pa_unix_socket_remove_stale(tmp)) < 0) { |