aboutsummaryrefslogtreecommitdiffstats
path: root/src/client_new.c
diff options
context:
space:
mode:
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