]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/core-util.c
util: /etc/machine-id should be tried first, the D-Bus only as fallback for legacy...
[pulseaudio] / src / pulsecore / core-util.c
index 61f980e7d99a1e61838a8779d43e04d111d1f44d..fe68965c50c0295be32fe91a68a2c93f87dae039 100644 (file)
@@ -2726,9 +2726,9 @@ char *pa_machine_id(void) {
     /* The returned value is supposed be some kind of ascii identifier
      * that is unique and stable across reboots. */
 
-    /* First we try the D-Bus UUID, which is the best option we have,
-     * since it fits perfectly our needs and is not as volatile as the
-     * hostname which might be set from dhcp. */
+    /* First we try the /etc/machine-id, which is the best option we
+     * have, since it fits perfectly our needs and is not as volatile
+     * as the hostname which might be set from dhcp. */
 
     if ((f = pa_fopen_cloexec(PA_MACHINE_ID, "r")) ||
         (f = pa_fopen_cloexec(PA_MACHINE_ID_FALLBACK, "r"))) {
@@ -2758,7 +2758,8 @@ char *pa_machine_id(void) {
 char *pa_session_id(void) {
     const char *e;
 
-    if (!(e = getenv("XDG_SESSION_COOKIE")))
+    e = getenv("XDG_SESSION_ID");
+    if (!e)
         return NULL;
 
     return pa_utf8_filter(e);