aboutsummaryrefslogtreecommitdiffstats
path: root/src/client_new.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-09-20 08:47:06 +0200
committerMax Kellermann <max@duempel.org>2011-09-20 08:47:06 +0200
commit921553d7bb38345ba99c069fa1ee7816d5130c9b (patch)
tree879a0384b9a4bc93e9b3c3c476812c660b7e63b4 /src/client_new.c
parent27946a981ff4192f064feb3117567463c137933f (diff)
parentc476819cb1186770b1b7395851e394caac39cbc8 (diff)
downloadmpd-921553d7bb38345ba99c069fa1ee7816d5130c9b.tar.gz
mpd-921553d7bb38345ba99c069fa1ee7816d5130c9b.tar.xz
mpd-921553d7bb38345ba99c069fa1ee7816d5130c9b.zip
Merge branch 'v0.16.x'
Diffstat (limited to 'src/client_new.c')
-rw-r--r--src/client_new.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/client_new.c b/src/client_new.c
index 5b2dfde65..1145c0236 100644
--- a/src/client_new.c
+++ b/src/client_new.c
@@ -19,9 +19,11 @@
#include "config.h"
#include "client_internal.h"
+#include "fd_util.h"
#include "fifo_buffer.h"
#include "socket_util.h"
#include "permission.h"
+#include "glib_socket.h"
#include <assert.h>
#include <sys/types.h>
@@ -69,7 +71,7 @@ client_new(struct player_control *player_control,
progname, hostaddr);
g_free(hostaddr);
- close(fd);
+ close_socket(fd);
return;
}
@@ -79,18 +81,14 @@ client_new(struct player_control *player_control,
if (client_list_is_full()) {
g_warning("Max Connections Reached!");
- close(fd);
+ close_socket(fd);
return;
}
client = g_new0(struct client, 1);
client->player_control = player_control;
-#ifndef G_OS_WIN32
- client->channel = g_io_channel_unix_new(fd);
-#else
- client->channel = g_io_channel_win32_new_socket(fd);
-#endif
+ client->channel = g_io_channel_new_socket(fd);
/* GLib is responsible for closing the file descriptor */
g_io_channel_set_close_on_unref(client->channel, true);
/* NULL encoding means the stream is binary safe; the MPD