From 29030b54c98b0aee65fbc10ebf7ba36bed98c02c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 10 Aug 2013 18:02:44 +0200 Subject: util/Error: new error passing library Replaces GLib's GError. --- src/TextInputStream.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/TextInputStream.cxx') 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 @@ -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 -- cgit v1.2.3