[maemo-commits] [maemo-commits] r12033 - in projects/haf/trunk/osso-gnome-vfs2/debian: . patches

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Fri Jun 1 14:03:27 EEST 2007
Author: richard
Date: 2007-06-01 14:03:25 +0300 (Fri, 01 Jun 2007)
New Revision: 12033

Added:
   projects/haf/trunk/osso-gnome-vfs2/debian/patches/31-daemon-restart-robustness.patch
Modified:
   projects/haf/trunk/osso-gnome-vfs2/debian/changelog
Log:
Improve robustness for restarted daemon.

Modified: projects/haf/trunk/osso-gnome-vfs2/debian/changelog
===================================================================
--- projects/haf/trunk/osso-gnome-vfs2/debian/changelog	2007-06-01 10:52:55 UTC (rev 12032)
+++ projects/haf/trunk/osso-gnome-vfs2/debian/changelog	2007-06-01 11:03:25 UTC (rev 12033)
@@ -1,6 +1,7 @@
 osso-gnome-vfs2 (2.16.3-1osso19) unstable; urgency=low
 
   * Use the slot_name property that HAL provides to identity the MMC cards
+  * Make the daemon/client more robust against restarted daemon
 
  -- Richard Hult <richard at imendio.com>  Fri,  1 Jun 2007 14:29:53 +0200
 

Added: projects/haf/trunk/osso-gnome-vfs2/debian/patches/31-daemon-restart-robustness.patch
===================================================================
--- projects/haf/trunk/osso-gnome-vfs2/debian/patches/31-daemon-restart-robustness.patch	2007-06-01 10:52:55 UTC (rev 12032)
+++ projects/haf/trunk/osso-gnome-vfs2/debian/patches/31-daemon-restart-robustness.patch	2007-06-01 11:03:25 UTC (rev 12033)
@@ -0,0 +1,56 @@
+Index: daemon/vfs-daemon.c
+===================================================================
+--- daemon/vfs-daemon.c	(revision 11974)
++++ daemon/vfs-daemon.c	(arbetskopia)
+@@ -562,6 +562,14 @@ daemon_handle_monitor_cancel (DBusConnec
+ 		return;
+ 	}
+ 
++	if (!monitors) {
++		/* Ignore this silently, can happen if the daemon is restarted
++		 * and the monitor hash isn't setup yet.
++		 */
++		dbus_util_reply_result (conn, message, GNOME_VFS_OK);
++		return;
++	}
++	
+ 	handle = g_hash_table_lookup (monitors, GINT_TO_POINTER (id));
+ 	if (handle) {
+ 		result = gnome_vfs_monitor_cancel (handle->vfs_handle);
+Index: libgnomevfs/gnome-vfs-daemon-method.c
+===================================================================
+--- libgnomevfs/gnome-vfs-daemon-method.c	(revision 11974)
++++ libgnomevfs/gnome-vfs-daemon-method.c	(arbetskopia)
+@@ -587,7 +587,7 @@ execute_operation (const gchar      *met
+ 		   ...)
+ {
+ 	DBusMessage *message;
+-	DBusMessage *reply;
++	DBusMessage *reply = NULL;
+ 	va_list      var_args;
+ 	gint32       cancellation_id;
+ 	DBusError    error;
+@@ -632,14 +632,17 @@ execute_operation (const gchar      *met
+ 
+ 	dbus_message_unref (message);
+ 	
+-	while (!dbus_pending_call_get_completed (pending_call) &&
+-	       dbus_connection_read_write_dispatch (connection->connection, -1))
+-		;
++	if (pending_call) {
++		while (!dbus_pending_call_get_completed (pending_call) &&
++		       dbus_connection_read_write_dispatch (connection->connection, -1))
++			;
+ 
+-	reply = dbus_pending_call_steal_reply (pending_call);
++		if (dbus_pending_call_get_completed (pending_call))
++			reply = dbus_pending_call_steal_reply (pending_call);
++
++		dbus_pending_call_unref (pending_call);
++	}
+ 
+-	dbus_pending_call_unref (pending_call);
+-	
+ 	if (cancellation_id != -1) {
+ 		cancellation_id_free (cancellation_id, context);
+ 	}


More information about the maemo-commits mailing list