summaryrefslogtreecommitdiff
path: root/test/run_resolver.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 /test/run_resolver.cxx
parentc9fcc7f14860777458153eb2d13c773ccfa1daa2 (diff)
util/Error: new error passing library
Replaces GLib's GError.
Diffstat (limited to 'test/run_resolver.cxx')
-rw-r--r--test/run_resolver.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/run_resolver.cxx b/test/run_resolver.cxx
index bb7f6deaa..559e12934 100644
--- a/test/run_resolver.cxx
+++ b/test/run_resolver.cxx
@@ -19,6 +19,9 @@
#include "config.h"
#include "system/Resolver.hxx"
+#include "util/Error.hxx"
+
+#include <glib.h>
#ifdef WIN32
#include <ws2tcpip.h>
@@ -37,23 +40,21 @@ int main(int argc, char **argv)
return EXIT_FAILURE;
}
- GError *error = NULL;
+ Error error;
struct addrinfo *ai =
resolve_host_port(argv[1], 80, AI_PASSIVE, SOCK_STREAM,
- &error);
+ error);
if (ai == NULL) {
- g_printerr("%s\n", error->message);
- g_error_free(error);
+ g_warning("%s", error.GetMessage());
return EXIT_FAILURE;
}
for (const struct addrinfo *i = ai; i != NULL; i = i->ai_next) {
char *p = sockaddr_to_string(i->ai_addr, i->ai_addrlen,
- &error);
+ error);
if (p == NULL) {
freeaddrinfo(ai);
- g_printerr("%s\n", error->message);
- g_error_free(error);
+ g_warning("%s", error.GetMessage());
return EXIT_FAILURE;
}