From a35eb7047116d0614d9d8dc9d1e435d45659d0d6 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Thu, 23 Sep 2010 18:57:35 -0400 Subject: [PATCH] GDBus: Use abstract namespace in test cases to avoid littering all over /tmp Signed-off-by: David Zeuthen --- gio/tests/gdbus-sessionbus.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gio/tests/gdbus-sessionbus.c b/gio/tests/gdbus-sessionbus.c index 6e70e02f3..66b146c2b 100644 --- a/gio/tests/gdbus-sessionbus.c +++ b/gio/tests/gdbus-sessionbus.c @@ -28,6 +28,8 @@ #include #include +#include + #include "gdbus-sessionbus.h" /* ---------------------------------------------------------------------------------------------------- */ @@ -304,8 +306,10 @@ session_bus_get_temporary_address (void) { if (temporary_address == NULL) { - /* TODO: maybe use a more random name etc etc */ - temporary_address = g_strdup_printf ("unix:path=/tmp/g-dbus-tests-pid-%d", getpid ()); + gchar *guid; + guid = g_dbus_generate_guid (); + temporary_address = g_strdup_printf ("unix:abstract=/tmp/g-dbus-tests-pid-%d-uuid-%s", getpid (), guid); + g_free (guid); } return temporary_address;