aboutsummaryrefslogtreecommitdiffstats
path: root/src/client_new.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-09-19 21:04:19 +0200
committerMax Kellermann <max@duempel.org>2011-09-20 08:38:58 +0200
commitc476819cb1186770b1b7395851e394caac39cbc8 (patch)
tree7e2d236e71ac88238026bb8803bfa87121c00f1d /src/client_new.c
parent77a56c7c5a1ab6bc0d76e0cf55f24071be7c4b5f (diff)
downloadmpd-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/client_new.c')
-rw-r--r--src/client_new.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client_new.c b/src/client_new.c
index 0ee21916b..e764a6550 100644
--- a/src/client_new.c
+++ b/src/client_new.c
@@ -19,6 +19,7 @@
#include "config.h"
#include "client_internal.h"
+#include "fd_util.h"
#include "fifo_buffer.h"
#include "socket_util.h"
#include "permission.h"
@@ -67,7 +68,7 @@ void client_new(int fd, const struct sockaddr *sa, size_t sa_length, int uid)
progname, hostaddr);
g_free(hostaddr);
- close(fd);
+ close_socket(fd);
return;
}
@@ -77,7 +78,7 @@ void client_new(int fd, const struct sockaddr *sa, size_t sa_length, int uid)
if (client_list_is_full()) {
g_warning("Max Connections Reached!");
- close(fd);
+ close_socket(fd);
return;
}