[evolution-data-server/evolution-data-server-3-12] [IMAPx] Avoid useless console warnings after a call to g_rename()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/evolution-data-server-3-12] [IMAPx] Avoid useless console warnings after a call to g_rename()
- Date: Wed, 18 Jun 2014 10:15:56 +0000 (UTC)
commit af76a3d9f4acd58332db69b0427288f7d773dd47
Author: Milan Crha <mcrha redhat com>
Date: Wed Jun 18 12:13:00 2014 +0200
[IMAPx] Avoid useless console warnings after a call to g_rename()
Some cases when g_rename() is called with nonexistent source file
are valid, like when appending a message to a (Sent) folder, thus
do not claim on console in such situations.
camel/providers/imapx/camel-imapx-server.c | 2 +-
camel/providers/imapx/camel-imapx-store.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 0a23341..a29a18d 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -5419,7 +5419,7 @@ imapx_command_append_message_done (CamelIMAPXServer *is,
mi->uid = camel_pstring_add (data->appended_uid, FALSE);
cur = camel_data_cache_get_filename (ifolder->cache, "cur", mi->uid);
- if (g_rename (data->path, cur) == -1) {
+ if (g_rename (data->path, cur) == -1 && errno != ENOENT) {
g_warning ("%s: Failed to rename '%s' to '%s': %s", G_STRFUNC, data->path,
cur, g_strerror (errno));
}
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index df18873..7060a6e 100644
--- a/camel/providers/imapx/camel-imapx-store.c
+++ b/camel/providers/imapx/camel-imapx-store.c
@@ -327,7 +327,7 @@ imapx_store_rename_storage_path (CamelIMAPXStore *imapx_store,
new_storage_path =
imapx_path_to_physical (root_storage_path, new_mailbox);
- if (g_rename (old_storage_path, new_storage_path) == -1) {
+ if (g_rename (old_storage_path, new_storage_path) == -1 && errno != ENOENT) {
g_warning (
"Could not rename message cache "
"'%s' to '%s: %s: cache reset",
@@ -2175,7 +2175,7 @@ imapx_migrate_to_user_cache_dir (CamelService *service)
g_mkdir_with_parents (parent_dir, S_IRWXU);
g_free (parent_dir);
- if (g_rename (user_data_dir, user_cache_dir) == -1)
+ if (g_rename (user_data_dir, user_cache_dir) == -1 && errno != ENOENT)
g_debug ("%s: Failed to migrate '%s' to '%s': %s", G_STRFUNC, user_data_dir,
user_cache_dir, g_strerror (errno));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]