aboutsummaryrefslogtreecommitdiffstats
path: root/src/text_input_stream.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-14 23:53:04 +0100
committerMax Kellermann <max@duempel.org>2009-12-15 23:12:11 +0100
commit228b03edf8513aa1cdaf4e4647279cc580245555 (patch)
tree7f5b03a9727fb8c371885469296eb7f49f6fa68b /src/text_input_stream.c
parentd000d31355c824a076324b647a3f056aab9ddabe (diff)
downloadmpd-228b03edf8513aa1cdaf4e4647279cc580245555.tar.gz
mpd-228b03edf8513aa1cdaf4e4647279cc580245555.tar.xz
mpd-228b03edf8513aa1cdaf4e4647279cc580245555.zip
input_stream: return errors with GError
Diffstat (limited to '')
-rw-r--r--src/text_input_stream.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/text_input_stream.c b/src/text_input_stream.c
index fd402590e..3836430c7 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);