diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-08-11 04:56:45 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2011-08-11 04:56:45 +0000 |
commit | d7d8605f1f5ac52f84a6f3dddb3d952f1ff60f54 (patch) | |
tree | 28899b317c1128b57e71afcf3a3fada0cdc06698 /libsylph | |
parent | b5c5303e14041f061843e5c8db1d1ff31d2977a7 (diff) |
removed warnings when cache files were not found.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2937 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph')
-rw-r--r-- | libsylph/procmsg.c | 17 |
1 files changed, 15 insertions, 2 deletions
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); |