[evolution-data-server/evolution-data-server-3-12] camel: Print a warning on failing to save migrated maildir version
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/evolution-data-server-3-12] camel: Print a warning on failing to save migrated maildir version
- Date: Tue, 20 May 2014 10:12:54 +0000 (UTC)
commit ff2b1de0827bf6810c31c9593fbd82efa8ef3618
Author: Philip Withnall <philip withnall collabora co uk>
Date: Mon May 19 14:33:10 2014 +0100
camel: Print a warning on failing to save migrated maildir version
Rather than ignoring potential failure completely.
Coverity issue: #1214488
https://bugzilla.gnome.org/show_bug.cgi?id=730375
camel/providers/local/camel-maildir-store.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index d60ba96..4cdbf3c 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -1275,7 +1275,7 @@ maildir_migrate_hierarchy (CamelMaildirStore *mstore,
GError **error)
{
CamelFolderInfo *topfi;
- gchar *meta_path, *ptr;
+ gchar *meta_path = NULL, *ptr;
topfi = camel_folder_info_new ();
topfi->full_name = g_strdup (".");
@@ -1283,8 +1283,7 @@ maildir_migrate_hierarchy (CamelMaildirStore *mstore,
if (scan_old_dir_info ((CamelStore *) mstore, topfi, error) == -1) {
g_warning ("Failed to scan the old folder info \n");
- camel_folder_info_free (topfi);
- return;
+ goto done;
}
if (maildir_version < 1)
@@ -1297,8 +1296,12 @@ maildir_migrate_hierarchy (CamelMaildirStore *mstore,
/* cannot pass dot inside maildir_get_meta_path(), because it is escaped */
ptr[0] = '.';
- g_file_set_contents (meta_path, MAILDIR_CONTENT_VERSION_STR, -1, NULL);
+ if (!g_file_set_contents (meta_path, MAILDIR_CONTENT_VERSION_STR, -1, error)) {
+ g_warning ("Failed to save the maildir version in ‘%s’.", meta_path);
+ goto done;
+ }
+done:
camel_folder_info_free (topfi);
g_free (meta_path);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]