[evolution-data-server] Bug #624135 - Gerror with imap provider when clicked 'cancel'



commit dbdba77f95e093561cfeafa776e4fdd912630a64
Author: Milan Crha <mcrha redhat com>
Date:   Mon Sep 6 09:39:13 2010 +0200

    Bug #624135 - Gerror with imap provider when clicked 'cancel'

 camel/camel-tcp-stream-raw.c             |   11 ++++++++---
 camel/providers/imap/camel-imap-folder.c |    2 +-
 2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c
index d641ef2..5695f62 100644
--- a/camel/camel-tcp-stream-raw.c
+++ b/camel/camel-tcp-stream-raw.c
@@ -242,8 +242,13 @@ _set_errno_from_pr_error (gint pr_code)
 void
 _set_g_error_from_errno (GError **error, gboolean eintr_means_cancelled)
 {
+	gint errn = errno;
+
+	if (error)
+		g_clear_error (error);
+
 	/* This is stolen from camel_read() / camel_write() */
-	if (eintr_means_cancelled && errno == EINTR)
+	if (eintr_means_cancelled && errn == EINTR)
 		g_set_error (
 			error, G_IO_ERROR,
 			G_IO_ERROR_CANCELLED,
@@ -251,8 +256,8 @@ _set_g_error_from_errno (GError **error, gboolean eintr_means_cancelled)
 	else
 		g_set_error (
 			error, G_IO_ERROR,
-			g_io_error_from_errno (errno),
-			"%s", g_strerror (errno));
+			g_io_error_from_errno (errn),
+			"%s", g_strerror (errn));
 }
 
 static gssize
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 478ed37..7bbf5d5 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -753,7 +753,7 @@ imap_refresh_info (CamelFolder *folder,
 	 * should do it.  */
 	camel_service_lock (CAMEL_SERVICE (imap_store), CAMEL_SERVICE_REC_CONNECT_LOCK);
 
-	if (camel_application_is_exiting  || !camel_imap_store_connected(imap_store, error))
+	if (camel_application_is_exiting  || !camel_imap_store_connected(imap_store, &local_error))
 		goto done;
 
 	/* try to store local changes first, as the summary contains new local messages */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]