From: Nils Durner Date: Sat, 13 Feb 2010 23:25:06 +0000 (+0000) Subject: fix MinGW, more precise type/error code handling X-Git-Tag: initial-import-from-subversion-38251~22733 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e4936b6d184608895e10d8e69ffecf8ef7df48f7;p=oweals%2Fgnunet.git fix MinGW, more precise type/error code handling --- diff --git a/src/util/network.c b/src/util/network.c index 4f652a52f..e7a276422 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -38,7 +38,11 @@ struct GNUNET_NETWORK_Handle { +#ifndef MINGW int fd; +#else + SOCKET fd; +#endif }; @@ -57,7 +61,7 @@ struct GNUNET_NETWORK_FDSet #ifdef WINDOWS /** - * Linked list of handles + * Linked list of handles */ struct GNUNET_CONTAINER_SList *handles; #endif @@ -368,12 +372,16 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle int pending; /* How much is there to be read? */ +#ifndef WINDOWS error = ioctl (desc->fd, FIONREAD, &pending); - if (error == 0) +#else + error = ioctlsocket (desc->fd, FIONREAD, &pending); + if (error != SOCKET_ERROR) +#endif return pending; else - return error; + return GNUNET_NO; } /**