diff options
author | tradke <tradke@9697cf00-7f2a-4e1b-af3c-314b8e4b499e> | 2002-06-03 15:35:13 +0000 |
---|---|---|
committer | tradke <tradke@9697cf00-7f2a-4e1b-af3c-314b8e4b499e> | 2002-06-03 15:35:13 +0000 |
commit | b4c8c9adf398f17c75a8307524ea50688b529eaf (patch) | |
tree | e7af17b776cd05d4f3d8ccef2d412ba7a451247e | |
parent | fc8fe0a3dad56e9dd66fb3bb473ab275193f1f9a (diff) |
Fix to make it compiling under Windows.
Still the error code checking is wrong: should compare against WSA<ERRNO>
instead of just <ERRNO>.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusConnect/Socket/trunk@23 9697cf00-7f2a-4e1b-af3c-314b8e4b499e
-rw-r--r-- | src/Utils.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Utils.c b/src/Utils.c index 573ab1f..ffa4d3a 100644 --- a/src/Utils.c +++ b/src/Utils.c @@ -21,6 +21,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <errno.h> #ifdef HAVE_NETDB_H #include <netdb.h> @@ -67,7 +68,6 @@ CCTK_FILEVERSION(CactusConnect_Socket_Utils_c) #endif #ifdef SOCKET_HAVE_UNIX_SOCKETS -#include <errno.h> #define IOCTL_SOCKET(a, b, c) ioctl(a, b, c) #else #define errno WSAGetLastError() @@ -366,11 +366,13 @@ int Socket_TCPBlockingWrite (SOCKET s, const char *buffer, int buflen) perror("an io error occured"); #endif break; +#ifdef EWOULDBLOCK case EWOULDBLOCK: #ifdef PERRORS perror("Non-blocking I/O is specified by ioctl"); perror("but socket has no data (would have blocked)."); #endif +#endif break; } } @@ -420,11 +422,13 @@ int Socket_TCPBlockingRead(SOCKET s,char *buffer, int buflen) perror("disable signals and try again"); #endif break; +#ifdef EWOULDBLOCK case EWOULDBLOCK: #ifdef PERRORS perror("Non-blocking I/O is specified by ioctl"); perror("but socket has no data (would have blocked)."); #endif +#endif break; } } |