[gnome-builder] worker: use abstract socket in /tmp/ like gio examples
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] worker: use abstract socket in /tmp/ like gio examples
- Date: Fri, 30 Oct 2015 21:17:51 +0000 (UTC)
commit 5f3f3628489c3135d02051916ed010f0020cb691
Author: Christian Hergert <chergert redhat com>
Date: Tue Oct 20 18:27:35 2015 -0700
worker: use abstract socket in /tmp/ like gio examples
Seems rather cargo cultish, but I don't know what the requirement is here.
Needs further investigation.
libide/ide-worker-manager.c | 25 +++++++++++++++----------
1 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/libide/ide-worker-manager.c b/libide/ide-worker-manager.c
index 5b77007..1c1edce 100644
--- a/libide/ide-worker-manager.c
+++ b/libide/ide-worker-manager.c
@@ -110,26 +110,31 @@ ide_worker_manager_constructed (GObject *object)
IdeWorkerManager *self = (IdeWorkerManager *)object;
g_autofree gchar *guid = NULL;
g_autofree gchar *address = NULL;
- g_autofree gchar *tmpdir = NULL;
GError *error = NULL;
- g_return_if_fail (IDE_IS_WORKER_MANAGER (self));
+ g_assert (IDE_IS_WORKER_MANAGER (self));
G_OBJECT_CLASS (ide_worker_manager_parent_class)->constructed (object);
if (g_unix_socket_address_abstract_names_supported ())
- tmpdir = g_strdup_printf ("%s/gnome-builder-worker-%u",
- g_get_tmp_dir (), getpid ());
+ {
+ address = g_strdup_printf ("unix:abstract=/tmp/gnome-builder-%u", (int)getpid ());
+ }
else
- tmpdir = g_dir_make_tmp ("gnome-builder-worker-XXXXXX", NULL);
-
- if (tmpdir == NULL)
{
- g_error ("Failed to determine temporary directory for DBus.");
- exit (EXIT_FAILURE);
+ g_autofree gchar *tmpdir = NULL;
+
+ tmpdir = g_dir_make_tmp ("gnome-builder-worker-XXXXXX", NULL);
+
+ if (tmpdir == NULL)
+ {
+ g_error ("Failed to determine temporary directory for DBus.");
+ exit (EXIT_FAILURE);
+ }
+
+ address = g_strdup_printf ("unix:tmpdir=%s", tmpdir);
}
- address = g_strdup_printf ("unix:tmpdir=%s", tmpdir);
guid = g_dbus_generate_guid ();
self->dbus_server = g_dbus_server_new_sync (address,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]