diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-04-13 22:20:48 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-04-13 22:20:48 +0200 |
commit | 1b4e5f197a9bef30fc13c592cbfd65d2c9a9476a (patch) | |
tree | 6fbd9d28875f6695c48831adfc7f61cc0c10af10 /src/pulsecore/core-util.c | |
parent | 17f1784cb7057bb8ea3da94d14dcbfc5b37ae8b7 (diff) |
core-util: add pa_session_id()
Diffstat (limited to 'src/pulsecore/core-util.c')
-rw-r--r-- | src/pulsecore/core-util.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index 56253391..f4776f2e 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -2502,6 +2502,15 @@ char *pa_machine_id(void) { return pa_sprintf_malloc("%08lx", (unsigned long) gethostid); } +char *pa_session_id(void) { + const char *e; + + if (!(e = getenv("XDG_SESSION_COOKIE"))) + return NULL; + + return pa_utf8_filter(e); +} + char *pa_uname_string(void) { struct utsname u; |