diff options
author | Not Zed <NotZed@Ximian.com> | 2004-04-06 16:21:50 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-04-06 16:21:50 +0800 |
commit | f24ee0c5c97a394027b636d639be56dec7a01fb6 (patch) | |
tree | 7527afe8a5733ef9ac56ff6db86e872c03479277 /camel/camel-object.c | |
parent | 9279a2cf22757bba12c54598963099c638504c80 (diff) | |
download | gsoc2013-evolution-f24ee0c5c97a394027b636d639be56dec7a01fb6.tar.gz gsoc2013-evolution-f24ee0c5c97a394027b636d639be56dec7a01fb6.tar.zst gsoc2013-evolution-f24ee0c5c97a394027b636d639be56dec7a01fb6.zip |
** See bug #56464.
2004-04-06 Not Zed <NotZed@Ximian.com>
** See bug #56464.
* camel-folder.c (camel_folder_transfer_messages_to): do not lock
the source here.
(transfer_message_to): call the main entry point for get message
and append message.
** See bug #56050.
* camel-vee-store.c (vee_delete_folder): delete the state file if
it exists.
* camel-object.c (camel_object_state_write): create the parent dir
if we need to. Also spit a warning if we fail in the end.
* camel-vee-folder.c (camel_vee_folder_new): set the persistent
state file location.
(vee_sync): write the state file when we sync.
svn path=/trunk/; revision=25331
Diffstat (limited to 'camel/camel-object.c')
-rw-r--r-- | camel/camel-object.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/camel/camel-object.c b/camel/camel-object.c index f4469f8d9d..ed62737c23 100644 --- a/camel/camel-object.c +++ b/camel/camel-object.c @@ -28,6 +28,7 @@ #include <string.h> #include <pthread.h> #include <semaphore.h> +#include <errno.h> #include "camel-object.h" #include "camel-file-utils.h" @@ -1514,7 +1515,7 @@ int camel_object_state_write(void *vo) { CamelObject *obj = vo; int res = -1; - char *file, *savename; + char *file, *savename, *tmp; FILE *fp; camel_object_get(vo, NULL, CAMEL_OBJECT_STATE_FILE, &file, NULL); @@ -1522,6 +1523,12 @@ int camel_object_state_write(void *vo) return 0; savename = camel_file_util_savename(file); + tmp = strrchr(savename, '/'); + if (tmp) { + *tmp = 0; + camel_mkdir(savename, 0777); + *tmp = '/'; + } fp = fopen(savename, "w"); if (fp != NULL) { if (fwrite(CAMEL_OBJECT_STATE_FILE_MAGIC, 4, 1, fp) == 1 @@ -1533,6 +1540,8 @@ int camel_object_state_write(void *vo) } else { fclose(fp); } + } else { + g_warning("Could not save object state file to '%s': %s", savename, g_strerror(errno)); } g_free(savename); |