aboutsummaryrefslogtreecommitdiffstats
path: root/src/client_new.c
diff options
context:
space:
mode:
authorAvuton Olrich <avuton@gmail.com>2010-05-08 16:48:01 -0700
committerAvuton Olrich <avuton@gmail.com>2010-05-08 16:48:01 -0700
commit8341daca4a7b9d0274636f760b00539347ac13fb (patch)
tree9c6d575e791797db90b4f74d5088e9d7b57d7196 /src/client_new.c
parent136759a298606b9f0c83763962e9d7819ba120c6 (diff)
downloadmpd-8341daca4a7b9d0274636f760b00539347ac13fb.tar.gz
mpd-8341daca4a7b9d0274636f760b00539347ac13fb.tar.xz
mpd-8341daca4a7b9d0274636f760b00539347ac13fb.zip
client_new: Send greeting using send() rather than write().
This is portable for win32 and fixes client logins there.
Diffstat (limited to 'src/client_new.c')
-rw-r--r--src/client_new.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/client_new.c b/src/client_new.c
index beb8e14b7..781a36524 100644
--- a/src/client_new.c
+++ b/src/client_new.c
@@ -24,6 +24,12 @@
#include "permission.h"
#include <assert.h>
+#include <sys/types.h>
+#ifdef WIN32
+#include <winsock2.h>
+#else
+#include <sys/socket.h>
+#endif
#include <unistd.h>
#ifdef HAVE_LIBWRAP
@@ -111,7 +117,7 @@ void client_new(int fd, const struct sockaddr *sa, size_t sa_length, int uid)
client->send_buf_used = 0;
- (void)write(fd, GREETING, sizeof(GREETING) - 1);
+ (void)send(fd, GREETING, sizeof(GREETING) - 1, 0);
client_list_add(client);