From 0cb6ad1502012224c85b920999e5487c8af70ae2 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 10 Feb 2011 00:24:17 -0800 Subject: [PATCH] Use send() instead of write() if MINGW32. --- libguac/src/guacio.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libguac/src/guacio.c b/libguac/src/guacio.c index c0a14b8e..78ec98d6 100644 --- a/libguac/src/guacio.c +++ b/libguac/src/guacio.c @@ -68,8 +68,13 @@ ssize_t __guac_write(GUACIO* io, const char* buf, int count) { int retval; - /* Write and time how long the write takes (microseconds) */ +#ifdef __MINGW32__ + /* MINGW32 WINSOCK only works with send() */ + retval = send(io->fd, buf, count, 0); +#else + /* Use write() for all other platforms */ retval = write(io->fd, buf, count); +#endif return retval; }