From 228b03edf8513aa1cdaf4e4647279cc580245555 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 14 Nov 2009 23:53:04 +0100 Subject: input_stream: return errors with GError --- src/text_input_stream.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/text_input_stream.c') diff --git a/src/text_input_stream.c b/src/text_input_stream.c index fd402590..3836430c 100644 --- a/src/text_input_stream.c +++ b/src/text_input_stream.c @@ -57,6 +57,7 @@ text_input_stream_free(struct text_input_stream *tis) const char * text_input_stream_read(struct text_input_stream *tis) { + GError *error = NULL; void *dest; const char *src, *p; size_t length, nbytes; @@ -67,9 +68,15 @@ text_input_stream_read(struct text_input_stream *tis) do { dest = fifo_buffer_write(tis->buffer, &length); if (dest != NULL) { - nbytes = input_stream_read(tis->is, dest, length); + nbytes = input_stream_read(tis->is, dest, length, + &error); if (nbytes > 0) fifo_buffer_append(tis->buffer, nbytes); + else if (error != NULL) { + g_warning("%s", error->message); + g_error_free(error); + return NULL; + } } src = fifo_buffer_read(tis->buffer, &length); -- cgit v1.2.3