[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.191, 1.192

tss at dovecot.org tss at dovecot.org
Sun Nov 12 21:30:32 UTC 2006


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

Modified Files:
	mbox-sync.c 
Log Message:
If ftruncate() fails in error handling (it really shouldn't), log an error
about it anyway.



Index: mbox-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -d -r1.191 -r1.192
--- mbox-sync.c	2 Nov 2006 17:26:31 -0000	1.191
+++ mbox-sync.c	12 Nov 2006 21:30:29 -0000	1.192
@@ -1225,7 +1225,8 @@
 		}
 
 		/* out of disk space, truncate to empty */
-		(void)ftruncate(sync_ctx->write_fd, 0);
+		if (ftruncate(sync_ctx->write_fd, 0) < 0)
+			mbox_set_syscall_error(sync_ctx->mbox, "ftruncate()");
 	}
 
 	sync_ctx->base_uid_last_offset = 0; /* don't bother calculating */
@@ -1286,7 +1287,10 @@
 				  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);
+			if (ftruncate(sync_ctx->write_fd, file_size) < 0) {
+				mbox_set_syscall_error(sync_ctx->mbox,
+						       "ftruncate()");
+			}
 			return -1;
 		}
 		i_stream_sync(sync_ctx->input);



More information about the dovecot-cvs mailing list