aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-stream-fs.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-07-16 10:32:30 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-07-16 10:32:30 +0800
commit6c397fa70c89c4e3dbcab5b30901a64dbc5b89a2 (patch)
tree076e6508458fc2fc6e45ec6dd0d7ea4ae9ef0a99 /camel/camel-stream-fs.c
parent32380aa7c9a7d50f47d7b50780c560da6ce5fe3c (diff)
downloadgsoc2013-evolution-6c397fa70c89c4e3dbcab5b30901a64dbc5b89a2.tar.gz
gsoc2013-evolution-6c397fa70c89c4e3dbcab5b30901a64dbc5b89a2.tar.zst
gsoc2013-evolution-6c397fa70c89c4e3dbcab5b30901a64dbc5b89a2.zip
If we read 0 bytes, then set eos to TRUE.
2003-07-15 Jeffrey Stedfast <fejj@ximian.com> * camel-stream-fs.c (stream_read): If we read 0 bytes, then set eos to TRUE. svn path=/trunk/; revision=21820
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 501f704b6d..9f67cd9e40 100644
--- a/camel/camel-stream-fs.c
+++ b/camel/camel-stream-fs.c
@@ -215,11 +215,15 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
{
CamelStreamFs *stream_fs = CAMEL_STREAM_FS (stream);
CamelSeekableStream *seekable = CAMEL_SEEKABLE_STREAM (stream);
+ ssize_t nread;
if (seekable->bound_end != CAMEL_STREAM_UNBOUND)
n = MIN (seekable->bound_end - seekable->position, n);
- return camel_read (stream_fs->fd, buffer, n);
+ if ((nread = camel_read (stream_fs->fd, buffer, n)) == 0)
+ stream->eos = TRUE;
+
+ return nread;
}
static ssize_t