[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.168, 1.169

cras at dovecot.org cras at dovecot.org
Sun Aug 7 14:50:19 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv28770/src/lib-storage/index/mbox

Modified Files:
	mbox-sync.c 
Log Message:
If mbox file growing failed, truncate it back to original size so extra NUL
chars aren't left at the end of it.



Index: mbox-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.168
retrieving revision 1.169
diff -u -d -r1.168 -r1.169
--- mbox-sync.c	7 Aug 2005 11:28:13 -0000	1.168
+++ mbox-sync.c	7 Aug 2005 11:50:17 -0000	1.169
@@ -1254,6 +1254,7 @@
 				  file_size + -sync_ctx->space_diff) < 0) {
 			mbox_set_syscall_error(sync_ctx->mbox,
 					       "file_set_size()");
+			(void)ftruncate(sync_ctx->write_fd, file_size);
 			return -1;
 		}
 		i_stream_sync(sync_ctx->input);



More information about the dovecot-cvs mailing list