[gvfs] client: Handle error events when polling	_g_vfs_daemon_call_sync ()
- From: Christian Kellner <gicmo src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gvfs] client: Handle error events when polling	_g_vfs_daemon_call_sync ()
- Date: Wed, 25 May 2011 13:45:27 +0000 (UTC)
commit 6eed5cc4188a0c95a8c004f3a295b57adf7b56d1
Author: Christian Kellner <gicmo gnome org>
Date:   Wed May 25 15:11:52 2011 +0200
    client: Handle error events when polling _g_vfs_daemon_call_sync ()
    
    Check for G_IO_NVAL,  G_IO_ERR and G_IO_HUP when we (succesfully)
    returned from g_poll since we get into a infinite loop later otherwise.
 client/gvfsdaemondbus.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/client/gvfsdaemondbus.c b/client/gvfsdaemondbus.c
index 81fbfe0..a7a56df 100644
--- a/client/gvfsdaemondbus.c
+++ b/client/gvfsdaemondbus.c
@@ -770,6 +770,14 @@ _g_vfs_daemon_call_sync (DBusMessage *message,
 			   "poll error");
 	      goto out;
 	    }
+
+	  if (poll_fds[0].revents & (G_IO_NVAL |  G_IO_ERR | G_IO_HUP))
+	    {
+	      dbus_pending_call_unref (pending);
+	      g_cancellable_release_fd (cancellable);
+	      invalidate_local_connection (dbus_id, error);
+	      goto out;
+	    }
 	  
 	  if (!sent_cancel && g_cancellable_is_cancelled (cancellable))
 	    {
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]