diff options
author | Alexander Larsson <alexl@src.gnome.org> | 2007-09-13 10:38:43 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2007-09-13 10:38:43 +0000 |
commit | dbdf5558756bc1469e017d0f9b638affc9289bba (patch) | |
tree | 4ec20061ddaa0e55270016a247374ff2d939581a /daemon/gvfsdaemon.c | |
parent | 3eb2c102c1d95a7cd205267754a38799792a66c2 (diff) | |
download | gvfs-dbdf5558756bc1469e017d0f9b638affc9289bba.tar.gz |
Use NameLost instead of NameOwnerChanged
Original git commit by Alexander Larsson <alex@greebo.(none)> at 1165844712 +0100
svn path=/trunk/; revision=223
Diffstat (limited to 'daemon/gvfsdaemon.c')
-rw-r--r-- | daemon/gvfsdaemon.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/daemon/gvfsdaemon.c b/daemon/gvfsdaemon.c index 2cbadfa2..00b58de2 100644 --- a/daemon/gvfsdaemon.c +++ b/daemon/gvfsdaemon.c @@ -190,7 +190,7 @@ g_vfs_daemon_new (gboolean main_daemon, gboolean replace) dbus_bus_add_match (conn, "sender='org.freedesktop.DBus'," "interface='org.freedesktop.DBus'," - "member='NameOwnerChanged'", + "member='NameLost'", &error); if (dbus_error_is_set (&error)) { @@ -797,27 +797,17 @@ daemon_message_func (DBusConnection *conn, RegisteredPath *registered_path; const char *path; - if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) + if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameLost")) { - char *name, *from, *to; + char *name; if (dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &name, - DBUS_TYPE_STRING, &from, - DBUS_TYPE_STRING, &to, - DBUS_TYPE_INVALID)) + DBUS_TYPE_INVALID) && + strcmp (name, G_VFS_DBUS_DAEMON_NAME) == 0) { - const char *my_name = dbus_bus_get_unique_name (conn); - - g_print ("NameOwnerChanged %s %s->%s (my name: %s)\n", name, from, to, my_name); - - /* TODO: We should use NameLost here */ - if (strcmp (name, G_VFS_DBUS_DAEMON_NAME) == 0) - { - /* Someone else got the name (i.e. someone used --replace), exit */ - if (daemon->priv->main_daemon && - strcmp (to, my_name) != 0) - exit (1); - } + /* Someone else got the name (i.e. someone used --replace), exit */ + if (daemon->priv->main_daemon) + exit (1); } } |