]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
maildir: If saving fails, don't bother trying to flush the file's ostream.
authorTimo Sirainen <tss@iki.fi>
Sat, 10 Dec 2011 06:01:02 +0000 (08:01 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 10 Dec 2011 06:01:02 +0000 (08:01 +0200)
src/lib-storage/index/maildir/maildir-save.c

index 6f85c7b0aa64f27a4b286029166229b426b6da6d..f19e6a2943802852de1a4cb893b83d2fe16d40e8 100644 (file)
@@ -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);