forked from enlightenment/enlightenment
e17 mixer - use XDG_RUNTIME_DIR for finding pulse... and have more
generous fallbacks.
This commit is contained in:
parent
0985de0051
commit
2a7a3a557f
|
@ -713,13 +713,37 @@ pulse_new(void)
|
||||||
if (!prev)
|
if (!prev)
|
||||||
{
|
{
|
||||||
struct stat st;
|
struct stat st;
|
||||||
buf = eina_stringshare_add(STATEDIR "/run/pulse/native");
|
char *s;
|
||||||
if (stat(buf, &st))
|
|
||||||
|
s = getenv("XDG_RUNTIME_DIR");
|
||||||
|
buf = eina_stringshare_add(s);
|
||||||
|
if ((!s) || ((buf) && (stat(buf, &st))))
|
||||||
{
|
{
|
||||||
INF("could not locate local socket '%s'!", buf);
|
snprintf(h, sizeof(h), "/run/user/%i/pulse/native",
|
||||||
free(conn);
|
(int)getuid());
|
||||||
return NULL;
|
if (stat(h, &st))
|
||||||
|
{
|
||||||
|
snprintf(h, sizeof(h), "%s/run/user/%i/pulse/native",
|
||||||
|
STATEDIR, (int)getuid());
|
||||||
|
if (stat(h, &st))
|
||||||
|
{
|
||||||
|
buf = eina_stringshare_add(STATEDIR "/run/pulse/native");
|
||||||
|
if (stat(buf, &st))
|
||||||
|
{
|
||||||
|
eina_stringshare_del(buf);
|
||||||
|
INF("could not locate local socket '%s'!", buf);
|
||||||
|
free(conn);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
buf = eina_stringshare_add(h);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
buf = eina_stringshare_add(h);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
buf = eina_stringshare_add(h);
|
||||||
conn->socket = buf;
|
conn->socket = buf;
|
||||||
}
|
}
|
||||||
else conn->socket = prev;
|
else conn->socket = prev;
|
||||||
|
|
Loading…
Reference in New Issue