[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync.c, 1.181.2.6, 1.181.2.7
tss at dovecot.org
tss at dovecot.org
Sun Nov 12 21:30:29 UTC 2006
Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv28595/lib-storage/index/mbox
Modified Files:
Tag: branch_1_0
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.181.2.6
retrieving revision 1.181.2.7
diff -u -d -r1.181.2.6 -r1.181.2.7
--- mbox-sync.c 2 Nov 2006 17:26:29 -0000 1.181.2.6
+++ mbox-sync.c 12 Nov 2006 21:30:27 -0000 1.181.2.7
@@ -1229,7 +1229,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 */
@@ -1290,7 +1291,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