[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-save.c,1.16,1.17
cras at procontrol.fi
cras at procontrol.fi
Thu Jan 23 05:34:02 EET 2003
- Previous message: [dovecot-cvs] dovecot/src/imap client.c,1.22,1.23 client.h,1.8,1.9 cmd-append.c,1.21,1.22 commands-util.c,1.18,1.19
- Next message: [dovecot-cvs] dovecot/src/lib-index mail-modifylog.c,1.41,1.42
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/dovecot/src/lib-storage/index/maildir
In directory danu:/tmp/cvs-serv6246/lib-storage/index/maildir
Modified Files:
maildir-save.c
Log Message:
When save is aborted, remove the created temp files.
Index: maildir-save.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/maildir/maildir-save.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- maildir-save.c 22 Jan 2003 19:23:28 -0000 1.16
+++ maildir-save.c 23 Jan 2003 03:34:00 -0000 1.17
@@ -213,10 +213,19 @@
int maildir_storage_save_deinit(struct mail_save_context *ctx, int rollback)
{
struct mail_filename *mf, *mf2;
- const char *new_path;
+ const char *path;
int failed = FALSE;
- if (!rollback) {
+ if (rollback) {
+ /* clean up the temp files */
+ for (mf = ctx->files; mf != NULL; mf = mf->next) {
+ t_push();
+ path = t_strconcat(ctx->tmpdir, "/", mf->dest, NULL);
+ (void)unlink(path);
+ t_pop();
+ }
+ } else {
+ /* move them into new/ */
for (mf = ctx->files; mf != NULL; mf = mf->next) {
if (!maildir_copy(ctx, mf->src, mf->dest)) {
failed = TRUE;
@@ -228,9 +237,9 @@
/* failed, try to unlink the mails already moved */
for (mf2 = ctx->files; mf2 != mf; mf2 = mf2->next) {
t_push();
- new_path = t_strconcat(ctx->newdir, "/",
- mf2->dest, NULL);
- (void)unlink(new_path);
+ path = t_strconcat(ctx->newdir, "/",
+ mf2->dest, NULL);
+ (void)unlink(path);
t_pop();
}
}
- Previous message: [dovecot-cvs] dovecot/src/imap client.c,1.22,1.23 client.h,1.8,1.9 cmd-append.c,1.21,1.22 commands-util.c,1.18,1.19
- Next message: [dovecot-cvs] dovecot/src/lib-index mail-modifylog.c,1.41,1.42
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list