[pulseaudio-commits] r1598 - /branches/lennart/src/modules/module-protocol-stub.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu Aug 9 09:27:25 PDT 2007


Author: lennart
Date: Thu Aug  9 18:27:24 2007
New Revision: 1598

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1598&root=3Dpulseaudio&vi=
ew=3Drev
Log:
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 comp=
atible with a patched esd, which however ubuntu and fedora ship now. other =
distros need to patch their esd as well, or may pass socket=3D/tmp/.esd/soc=
ket to module-protocol-esound-unix

Modified:
    branches/lennart/src/modules/module-protocol-stub.c

Modified: branches/lennart/src/modules/module-protocol-stub.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/mo=
dule-protocol-stub.c?rev=3D1598&root=3Dpulseaudio&r1=3D1597&r2=3D1598&view=
=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/modules/module-protocol-stub.c (original)
+++ branches/lennart/src/modules/module-protocol-stub.c Thu Aug  9 18:27:24=
 2007
@@ -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", "coo=
kie",
   #ifdef USE_TCP_SOCKETS
     #include "module-esound-protocol-tcp-symdef.h"
@@ -219,6 +218,10 @@
     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,18 +265,23 @@
 =

 #else
 =

+#if defined(USE_PROTOCOL_ESOUND)
+
+    snprintf(tmp2, sizeof(tmp2), "/tmp/.esd-%lu/socket", (unsigned long) g=
etuid());
+    pa_runtime_path(pa_modargs_get_value(ma, "socket", tmp2), tmp, sizeof(=
tmp));
+    u->socket_path =3D 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 */
+
+    if (pa_make_secure_parent_dir(u->socket_path, c->is_system_instance ? =
0755 : 0700, (uid_t)-1, (gid_t)-1) < 0) {
+        pa_log("Failed to create socket directory '%s': %s\n", u->socket_p=
ath, pa_cstrerror(errno));
+        goto fail;
+    }
+
+#else
     pa_runtime_path(pa_modargs_get_value(ma, "socket", UNIX_SOCKET), tmp, =
sizeof(tmp));
     u->socket_path =3D pa_xstrdup(tmp);
-
-#if defined(USE_PROTOCOL_ESOUND)
-
-    /* This socket doesn't reside in our own runtime dir but in
-     * /tmp/.esd/, hence we have to create the dir first */
-
-    if (pa_make_secure_parent_dir(u->socket_path, c->is_system_instance ? =
0755 : 0700, (uid_t)-1, (gid_t)-1) < 0) {
-        pa_log("Failed to create socket directory '%s': %s\n", u->socket_p=
ath, pa_cstrerror(errno));
-        goto fail;
-    }
 #endif
 =

     if ((r =3D pa_unix_socket_remove_stale(tmp)) < 0) {




More information about the pulseaudio-commits mailing list