aboutsummaryrefslogtreecommitdiffstats
path: root/src/TextInputStream.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-10 18:02:44 +0200
committerMax Kellermann <max@duempel.org>2013-09-04 18:14:22 +0200
commit29030b54c98b0aee65fbc10ebf7ba36bed98c02c (patch)
tree79766830b55ebca38ddbce84d8d548227eedb69e /src/TextInputStream.cxx
parentc9fcc7f14860777458153eb2d13c773ccfa1daa2 (diff)
downloadmpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.gz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.tar.xz
mpd-29030b54c98b0aee65fbc10ebf7ba36bed98c02c.zip
util/Error: new error passing library
Replaces GLib's GError.
Diffstat (limited to 'src/TextInputStream.cxx')
-rw-r--r--src/TextInputStream.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/TextInputStream.cxx b/src/TextInputStream.cxx
index bb4c8b868..486400f96 100644
--- a/src/TextInputStream.cxx
+++ b/src/TextInputStream.cxx
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003-2011 The Music Player Daemon Project
+ * Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
@@ -21,6 +21,7 @@
#include "TextInputStream.hxx"
#include "InputLegacy.hxx"
#include "util/fifo_buffer.h"
+#include "util/Error.hxx"
#include <glib.h>
@@ -40,7 +41,6 @@ TextInputStream::~TextInputStream()
bool TextInputStream::ReadLine(std::string &line)
{
- GError *error = nullptr;
void *dest;
const char *src, *p;
size_t length, nbytes;
@@ -53,13 +53,13 @@ bool TextInputStream::ReadLine(std::string &line)
newline character */
--length;
+ Error error;
nbytes = input_stream_lock_read(is, dest, length,
- &error);
+ error);
if (nbytes > 0)
fifo_buffer_append(buffer, nbytes);
- else if (error != nullptr) {
- g_warning("%s", error->message);
- g_error_free(error);
+ else if (error.IsDefined()) {
+ g_warning("%s", error.GetMessage());
return false;
}
} else