From: Timo Sirainen Date: Sat, 10 Dec 2011 06:01:02 +0000 (+0200) Subject: maildir: If saving fails, don't bother trying to flush the file's ostream. X-Git-Tag: 2.1.rc2~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=723277fd367f535cf11f1a4bf19a8b61a6f7072f;p=thirdparty%2Fdovecot%2Fcore.git maildir: If saving fails, don't bother trying to flush the file's ostream. --- diff --git a/src/lib-storage/index/maildir/maildir-save.c b/src/lib-storage/index/maildir/maildir-save.c index 6f85c7b0aa..f19e6a2943 100644 --- a/src/lib-storage/index/maildir/maildir-save.c +++ b/src/lib-storage/index/maildir/maildir-save.c @@ -524,7 +524,7 @@ static int maildir_save_finish_real(struct mail_save_context *_ctx) } path = t_strconcat(ctx->tmpdir, "/", ctx->file_last->tmp_name, NULL); - if (o_stream_flush(_ctx->output) < 0) { + if (!ctx->failed && o_stream_flush(_ctx->output) < 0) { if (!mail_storage_set_error_from_errno(storage)) { mail_storage_set_critical(storage, "o_stream_flush(%s) failed: %m", path);