+ char buf[BUFSIZ];
+ gsize bytes_read;
+ GError *error;
+ GIOStatus status;
+
+ error = NULL;
+read:
+ status = g_io_channel_read_chars (channel, buf, sizeof (buf), &bytes_read, &error);
+ if (status == G_IO_STATUS_NORMAL)
+ {
+ g_string_append_len (data->error_string, buf, bytes_read);
+ if (bytes_read == sizeof (buf))
+ goto read;
+ }
+ else if (status == G_IO_STATUS_EOF)
+ g_string_append_len (data->error_string, buf, bytes_read);
+ else if (status == G_IO_STATUS_ERROR)
+ {
+ if (data->error_string->len > 0)
+ g_string_append (data->error_string, "\n");
+
+ g_string_append (data->error_string, error->message);
+ g_error_free (error);
+ return FALSE;
+ }