From 6db2766e3fce0148fa4a5a5dc2a86fbbe5931415 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Sun, 29 Apr 2012 18:47:38 +0100 Subject: [PATCH] undefine macros for socket redirection, fix warnings --- mingw/mingw.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/mingw/mingw.c b/mingw/mingw.c index c394a16..0cae043 100644 --- a/mingw/mingw.c +++ b/mingw/mingw.c @@ -2,6 +2,11 @@ #include "mingw.h" +#undef socket +#undef connect +#undef accept +#undef shutdown + #include #include #include @@ -10,7 +15,7 @@ int win32_poll(struct pollfd *fds, unsigned int nfds, int timo) { struct timeval timeout, *toptr; fd_set ifds, ofds, efds, *ip, *op; - int i, rc; + unsigned int i, rc; /* Set up the file-descriptor sets in ifds, ofds and efds. */ FD_ZERO(&ifds); @@ -51,7 +56,7 @@ int win32_poll(struct pollfd *fds, unsigned int nfds, int timo) return rc; if(rc > 0) { - for (i = 0; i < nfds; ++i) { + for ( i = 0; i < nfds; ++i) { int fd = fds[i].fd; if(fds[i].events & (POLLIN|POLLPRI) && FD_ISSET(fd, &ifds)) fds[i].revents |= POLLIN; @@ -162,7 +167,7 @@ int win32_close_socket(SOCKET fd) { int rc; rc = closesocket(fd); - return 0; + return rc; } -- 2.30.2