aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-stream-fs.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-07-18 03:17:42 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-07-18 03:17:42 +0800
commit76c23a45f1737a6fc6d11b235ef753a082fe16cb (patch)
tree1bbbe0e39d55cc40204a92a6449fcb074ec3ec65 /camel/camel-stream-fs.c
parent7b6185cbe135d388e8bc872ab2a40fc67e1122f6 (diff)
downloadgsoc2013-evolution-76c23a45f1737a6fc6d11b235ef753a082fe16cb.tar.gz
gsoc2013-evolution-76c23a45f1737a6fc6d11b235ef753a082fe16cb.tar.zst
gsoc2013-evolution-76c23a45f1737a6fc6d11b235ef753a082fe16cb.zip
Increment the seekable stream position by the number of bytes read. Oops.
2003-07-17 Jeffrey Stedfast <fejj@ximian.com> * camel-stream-fs.c (stream_read): Increment the seekable stream position by the number of bytes read. Oops. (stream_write): Same here. svn path=/trunk/; revision=21862
Diffstat (limited to 'camel/camel-stream-fs.c')
-rw-r--r--camel/camel-stream-fs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c
index b86f146e59..6560512d0c 100644
--- a/camel/camel-stream-fs.c
+++ b/camel/camel-stream-fs.c
@@ -233,11 +233,15 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
{
CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream);
CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
+ ssize_t nwritten;
if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
n = MIN (seekable->bound_end - seekable->position, n);
- return camel_write (stream_fs->fd, buffer, n);
+ if ((nwritten = camel_write (stream_fs->fd, buffer, n)) > 0)
+ seekable->position += nwritten;
+
+ return nwritten;
}
static int