[glib] GDBus: Don't use abstract sockets in test code
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] GDBus: Don't use abstract sockets in test code
- Date: Thu, 23 Sep 2010 23:17:28 +0000 (UTC)
commit 4d9ae95ae05669f329381898c38e6a98ae7f0cd5
Author: David Zeuthen <davidz redhat com>
Date: Thu Sep 23 19:16:25 2010 -0400
GDBus: Don't use abstract sockets in test code
It doesn't really work right now because of a dbus-daemon(1) bug - see
the comment added in the TODO section of gdbusconnection.c. So revert
to old behavior. The downside is a lot of files in /tmp but right now
that's better than not being able to run tests in a loop.
Signed-off-by: David Zeuthen <davidz redhat com>
gio/gdbusconnection.c | 9 +++++++++
gio/tests/gdbus-sessionbus.c | 6 ++----
2 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c
index da2b9f9..a4abc14 100644
--- a/gio/gdbusconnection.c
+++ b/gio/gdbusconnection.c
@@ -90,6 +90,15 @@
* kind of pitfalls it avoids
* - Export objects before claiming names
* - Talk about auto-starting services (cf. GBusNameWatcherFlags)
+ *
+ * - use abstract sockets in test code
+ * - right now it doesn't work, dbus-daemon(1) fails with
+ *
+ * /gdbus/connection/filter: Failed to start message bus: Failed to bind
+ * socket "/tmp/g-dbus-tests-pid-28531": Address already in use
+ * ** WARNING **: Error reading address from dbus daemon, 0 bytes read
+ *
+ * or similar.
*/
#include "config.h"
diff --git a/gio/tests/gdbus-sessionbus.c b/gio/tests/gdbus-sessionbus.c
index 66b146c..e90bd1f 100644
--- a/gio/tests/gdbus-sessionbus.c
+++ b/gio/tests/gdbus-sessionbus.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
+#include <sys/wait.h>
#include <signal.h>
#include <stdio.h>
@@ -306,10 +307,7 @@ session_bus_get_temporary_address (void)
{
if (temporary_address == NULL)
{
- 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);
+ temporary_address = g_strdup_printf ("unix:path=/tmp/g-dbus-tests-pid-%d", getpid ());
}
return temporary_address;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]