aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-08-11 04:56:45 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-08-11 04:56:45 +0000
commitd7d8605f1f5ac52f84a6f3dddb3d952f1ff60f54 (patch)
tree28899b317c1128b57e71afcf3a3fada0cdc06698
parentb5c5303e14041f061843e5c8db1d1ff31d2977a7 (diff)
removed warnings when cache files were not found.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2937 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog5
-rw-r--r--libsylph/procmsg.c17
2 files changed, 20 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ee0ba01..2f97559a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2011-08-10
+ * libsylph/procmsg.c: procmsg_open_cache_file_mmap(): removed
+ warnings when cache files were not found.
+
+2011-08-10
+
* libsylph/html.c: minor code cleanup.
2011-08-10
diff --git a/libsylph/procmsg.c b/libsylph/procmsg.c
index 86436e39..525f9b47 100644
--- a/libsylph/procmsg.c
+++ b/libsylph/procmsg.c
@@ -1,6 +1,6 @@
/*
* LibSylph -- E-Mail client library
- * Copyright (C) 1999-2010 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2011 Hiroyuki Yamamoto
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -1103,6 +1103,7 @@ static GMappedFile *procmsg_open_cache_file_mmap(FolderItem *item,
{
gchar *cachefile;
GMappedFile *map = NULL;
+ GError *error = NULL;
gsize size;
guint32 data_ver = 0;
gchar *p;
@@ -1112,7 +1113,19 @@ static GMappedFile *procmsg_open_cache_file_mmap(FolderItem *item,
cachefile = folder_item_get_cache_file(item);
if (cachefile) {
- map = g_mapped_file_new(cachefile, FALSE, NULL);
+ map = g_mapped_file_new(cachefile, FALSE, &error);
+ if (!map) {
+ if (error && error->code == G_FILE_ERROR_NOENT)
+ debug_print("%s: mark/cache file not found\n", cachefile);
+ else if (error)
+ g_warning("%s: cannot open mark/cache file: %s", cachefile, error->message);
+ else
+ g_warning("%s: cannot open mark/cache file", cachefile);
+ if (error)
+ g_error_free(error);
+ g_free(cachefile);
+ return NULL;
+ }
size = g_mapped_file_get_length(map);
if (size < sizeof(data_ver)) {
g_warning("%s: cannot read mark/cache file (truncated?)", cachefile);