[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-save.c, 1.39, 1.40

cras at dovecot.org cras at dovecot.org
Sat Aug 28 12:32:10 EEST 2004


Update of /home/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv20462/lib-storage/index/maildir

Modified Files:
	maildir-save.c 
Log Message:
Don't crash if canceling saving



Index: maildir-save.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/maildir/maildir-save.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- maildir-save.c	23 Aug 2004 07:55:29 -0000	1.39
+++ maildir-save.c	28 Aug 2004 09:32:07 -0000	1.40
@@ -200,6 +200,7 @@
 	struct maildir_save_context *ctx = (struct maildir_save_context *)_ctx;
 	struct utimbuf buf;
 	const char *path;
+	int output_errno;
 
 	if (ctx->failed && ctx->fd == -1) {
 		/* tmp file creation failed */
@@ -221,6 +222,7 @@
 		}
 	}
 
+	output_errno = ctx->output->stream_errno;
 	o_stream_unref(ctx->output);
 	ctx->output = NULL;
 
@@ -245,7 +247,7 @@
 				"unlink(%s) failed: %m", path);
 		}
 
-		errno = ctx->output->stream_errno;
+		errno = output_errno;
 		if (ENOSPACE(errno)) {
 			mail_storage_set_error(ctx->ibox->box.storage,
 					       "Not enough disk space");



More information about the dovecot-cvs mailing list