changeset 1848:8222937d4434 HEAD

Fixes to make copying mail inside same mbox working.
author Timo Sirainen <tss@iki.fi>
date Wed, 29 Oct 2003 15:37:33 +0200
parents 920307c42b17
children 83c635deda0b
files src/lib-index/mbox/istream-mbox.c src/lib-index/mbox/mbox-index.c src/lib-storage/mail-save.c
diffstat 3 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mbox/istream-mbox.c	Wed Oct 29 15:37:02 2003 +0200
+++ b/src/lib-index/mbox/istream-mbox.c	Wed Oct 29 15:37:33 2003 +0200
@@ -80,7 +80,7 @@
 
 	if (limit != old_limit)
 		i_stream_set_read_limit(mstream->input, old_limit);
-	return ret;
+	return mstream->istream.pos == 0 ? -1 : (ssize_t)mstream->istream.pos;
 }
 
 static void _seek(struct _istream *stream, uoff_t v_offset)
--- a/src/lib-index/mbox/mbox-index.c	Wed Oct 29 15:37:02 2003 +0200
+++ b/src/lib-index/mbox/mbox-index.c	Wed Oct 29 15:37:33 2003 +0200
@@ -85,11 +85,6 @@
 						     MAIL_MMAP_BLOCK_SIZE,
 						     0, 0, FALSE);
 		} else {
-			if (lseek(index->mbox_fd, 0, SEEK_SET) < 0) {
-				mbox_set_syscall_error(index, "lseek()");
-				return NULL;
-			}
-
 			index->mbox_stream =
 				i_stream_create_file(index->mbox_fd,
 						     default_pool,
--- a/src/lib-storage/mail-save.c	Wed Oct 29 15:37:02 2003 +0200
+++ b/src/lib-storage/mail-save.c	Wed Oct 29 15:37:33 2003 +0200
@@ -167,6 +167,7 @@
 			errno = input->stream_errno;
 			if (errno == 0) {
 				/* EOF */
+				i_warning("%lld vs %lld\n", input->v_offset, input->v_limit);
 				if (input->v_offset != input->v_limit &&
 				    input->v_limit != 0) {
 					/* too early */