[evolution-data-server] server_side_source_remove(): Disregard G_IO_ERROR_NOT_FOUND.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] server_side_source_remove(): Disregard G_IO_ERROR_NOT_FOUND.
- Date: Sat, 7 Jul 2012 12:23:32 +0000 (UTC)
commit 89e5dce00c0cade068e6ab0407a23695675b3e15
Author: Matthew Barnes <mbarnes redhat com>
Date: Sat Jul 7 08:00:31 2012 -0400
server_side_source_remove(): Disregard G_IO_ERROR_NOT_FOUND.
libebackend/e-server-side-source.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/libebackend/e-server-side-source.c b/libebackend/e-server-side-source.c
index 048967c..b7ad5e3 100644
--- a/libebackend/e-server-side-source.c
+++ b/libebackend/e-server-side-source.c
@@ -573,7 +573,6 @@ server_side_source_remove (ESource *source,
ESourceRegistryServer *server;
GQueue queue = G_QUEUE_INIT;
GList *list, *link;
- gboolean success = TRUE;
GError *error = NULL;
/* XXX Yes we block here. We do this operation
@@ -609,9 +608,21 @@ server_side_source_remove (ESource *source,
file = e_server_side_source_get_file (child);
if (file != NULL)
- success = g_file_delete (file, cancellable, &error);
-
- if (!success)
+ g_file_delete (file, cancellable, &error);
+
+ /* XXX Even though e_source_registry_server_remove_source()
+ * is called first, the object path is unexported from
+ * an idle callback some time after we have deleted the
+ * key file. That creates a small window of time where
+ * the file is deleted but the object is still exported.
+ *
+ * If a client calls e_source_remove() during that small
+ * window of time, we still want to report a successful
+ * removal, so disregard G_IO_ERROR_NOT_FOUND. */
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
+ g_clear_error (&error);
+
+ if (error != NULL)
goto exit;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]