diff options
author | Max Kellermann <max@duempel.org> | 2011-09-19 21:04:19 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-09-20 08:38:58 +0200 |
commit | c476819cb1186770b1b7395851e394caac39cbc8 (patch) | |
tree | 7e2d236e71ac88238026bb8803bfa87121c00f1d /src/socket_util.c | |
parent | 77a56c7c5a1ab6bc0d76e0cf55f24071be7c4b5f (diff) | |
download | mpd-c476819cb1186770b1b7395851e394caac39cbc8.tar.gz mpd-c476819cb1186770b1b7395851e394caac39cbc8.tar.xz mpd-c476819cb1186770b1b7395851e394caac39cbc8.zip |
fd_util: add function close_socket()
Wrap close(), use closesocket() on WIN32/WinSock.
Diffstat (limited to 'src/socket_util.c')
-rw-r--r-- | src/socket_util.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/socket_util.c b/src/socket_util.c index 0909765ba..3f7075ed3 100644 --- a/src/socket_util.c +++ b/src/socket_util.c @@ -122,7 +122,7 @@ socket_bind_listen(int domain, int type, int protocol, if (ret < 0) { g_set_error(error, listen_quark(), errno, "setsockopt() failed: %s", g_strerror(errno)); - close(fd); + close_socket(fd); return -1; } @@ -130,7 +130,7 @@ socket_bind_listen(int domain, int type, int protocol, if (ret < 0) { g_set_error(error, listen_quark(), errno, "%s", g_strerror(errno)); - close(fd); + close_socket(fd); return -1; } @@ -138,7 +138,7 @@ socket_bind_listen(int domain, int type, int protocol, if (ret < 0) { g_set_error(error, listen_quark(), errno, "listen() failed: %s", g_strerror(errno)); - close(fd); + close_socket(fd); return -1; } |