summaryrefslogtreecommitdiff
path: root/daemon/main.c
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2015-01-28 12:45:47 +0100
committerOndrej Holy <oholy@redhat.com>2015-02-02 15:30:17 +0100
commit871113ca3e534522e9ed5e48c424b7160221514c (patch)
tree5b3476b73ca3b71e15946499451ded1389871feb /daemon/main.c
parent450dd38079dc8e0ed124b3149862659f32095c8c (diff)
downloadgvfs-871113ca3e534522e9ed5e48c424b7160221514c.tar.gz
daemon: register mount tracker skeleton by bus_acquired_handler
Mount tracker skeleton is registered by name_acquired_handler currently, however it is too late. Therefore e.g. mount operation could fail for the first time with the following error: No such interface `org.gtk.vfs.MountTracker' on object at path /org/gtk/vfs/mounttracker
Diffstat (limited to 'daemon/main.c')
-rw-r--r--daemon/main.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/daemon/main.c b/daemon/main.c
index 9c8eba5d..4f7c327a 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -71,14 +71,6 @@ on_name_acquired (GDBusConnection *connection,
already_acquired = TRUE;
- if (! mount_init ())
- {
- /* we were not able to properly initialize ourselves, bail out */
- g_main_loop_quit (loop);
- return;
- }
-
-
#ifdef HAVE_FUSE
if (!no_fuse)
{
@@ -121,6 +113,19 @@ on_name_acquired (GDBusConnection *connection,
}
static void
+on_bus_acquired (GDBusConnection *connection,
+ const gchar *name,
+ gpointer user_data)
+{
+ if (!mount_init ())
+ {
+ /* we were not able to properly initialize ourselves, bail out */
+ g_main_loop_quit (loop);
+ return;
+ }
+}
+
+static void
daemon_shutdown (GVfsDaemon *daemon,
GMainLoop *loop)
{
@@ -209,7 +214,7 @@ main (int argc, char *argv[])
name_owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
G_VFS_DBUS_DAEMON_NAME,
flags,
- NULL,
+ on_bus_acquired,
on_name_acquired,
on_name_lost,
GUINT_TO_POINTER (no_fuse),