aboutsummaryrefslogtreecommitdiffstats
path: root/src/system/SocketUtil.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/system/SocketUtil.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 '')
-rw-r--r--src/system/SocketUtil.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/system/SocketUtil.cxx b/src/system/SocketUtil.cxx
index dd7eb7dd2..abaedb8e7 100644
--- a/src/system/SocketUtil.cxx
+++ b/src/system/SocketUtil.cxx
@@ -41,38 +41,38 @@ int
socket_bind_listen(int domain, int type, int protocol,
const struct sockaddr *address, size_t address_length,
int backlog,
- GError **error_r)
+ Error &error)
{
int fd, ret;
const int reuse = 1;
fd = socket_cloexec_nonblock(domain, type, protocol);
if (fd < 0) {
- SetSocketError(error_r);
- g_prefix_error(error_r, "Failed to create socket: ");
+ SetSocketError(error);
+ error.AddPrefix("Failed to create socket: ");
return -1;
}
ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
(const char *) &reuse, sizeof(reuse));
if (ret < 0) {
- SetSocketError(error_r);
- g_prefix_error(error_r, "setsockopt() failed: ");
+ SetSocketError(error);
+ error.AddPrefix("setsockopt() failed: ");
close_socket(fd);
return -1;
}
ret = bind(fd, address, address_length);
if (ret < 0) {
- SetSocketError(error_r);
+ SetSocketError(error);
close_socket(fd);
return -1;
}
ret = listen(fd, backlog);
if (ret < 0) {
- SetSocketError(error_r);
- g_prefix_error(error_r, "listen() failed: ");
+ SetSocketError(error);
+ error.AddPrefix("listen() failed: ");
close_socket(fd);
return -1;
}