aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-stream-fs.c
diff options
context:
space:
mode:
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