gvfs r1782 - in branches/gnome-2-22: . client
- From: hansp svn gnome org
- To: svn-commits-list gnome org
- Subject: gvfs r1782 - in branches/gnome-2-22: . client
- Date: Fri, 23 May 2008 01:32:55 +0000 (UTC)
Author: hansp
Date: Fri May 23 01:32:55 2008
New Revision: 1782
URL: http://svn.gnome.org/viewvc/gvfs?rev=1782&view=rev
Log:
2008-05-22 Hans Petter Jansson <hpj novell com>
A more complete fix for GNOME bug #531516.
* client/gvfsfusedaemon.c (subthread_main): Send SIGHUP to the
main thread just before subthread exits.
(dbus_filter_func): When gvfsd goes away, exit the subthread's
main loop instead of immediately sending SIGHUP to parent thread.
Do the same when the session bus goes away.
(shutdown_on_idle): Remove, no longer needed.
(shutdown_signal): Remove, no longer needed.
(vfs_init): Tell dbus to not exit when session bus goes down.
Don't catch signals anymore, since Fuse does this for us.
Modified:
branches/gnome-2-22/ChangeLog
branches/gnome-2-22/client/gvfsfusedaemon.c
Modified: branches/gnome-2-22/client/gvfsfusedaemon.c
==============================================================================
--- branches/gnome-2-22/client/gvfsfusedaemon.c (original)
+++ branches/gnome-2-22/client/gvfsfusedaemon.c Fri May 23 01:32:55 2008
@@ -2017,6 +2017,9 @@
g_object_unref (volume_monitor);
volume_monitor = NULL;
+ /* Tell the main thread to unmount. Using kill() is necessary according to FUSE maintainers. */
+ kill (getpid (), SIGHUP);
+
return NULL;
}
@@ -2044,26 +2047,20 @@
*new_owner == 0)
{
/* The daemon died, unmount */
- kill (getpid(), SIGHUP);
+ g_main_loop_quit (subthread_main_loop);
}
}
+ else if (dbus_message_is_signal (message,
+ DBUS_INTERFACE_LOCAL,
+ "Disconnected"))
+ {
+ /* Session bus died, unmount */
+ g_main_loop_quit (subthread_main_loop);
+ }
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
-static gboolean
-shutdown_on_idle (void)
-{
- fuse_exit (fuse_get_context ()->fuse);
- return FALSE;
-}
-
-static void
-shutdown_signal (gint signum)
-{
- g_idle_add ((GSourceFunc) shutdown_on_idle, NULL);
-}
-
static gpointer
vfs_init (struct fuse_conn_info *conn)
{
@@ -2090,6 +2087,8 @@
return NULL;
}
+ dbus_connection_set_exit_on_disconnect (dbus_conn, FALSE);
+
_g_dbus_connection_integrate_with_main (dbus_conn);
dbus_bus_add_match (dbus_conn,
@@ -2116,11 +2115,6 @@
volume_monitor = g_object_new (g_type_from_name ("GDaemonVolumeMonitor"), NULL);
subthread_main_loop = g_main_loop_new (NULL, FALSE);
-
- signal (SIGHUP, shutdown_signal);
- signal (SIGTERM, shutdown_signal);
- signal (SIGINT, shutdown_signal);
-
subthread = g_thread_create ((GThreadFunc) subthread_main, NULL, FALSE, NULL);
return NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]