gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r10288 - gnunet/src/util


From: gnunet
Subject: [GNUnet-SVN] r10288 - gnunet/src/util
Date: Sun, 14 Feb 2010 00:25:06 +0100

Author: durner
Date: 2010-02-14 00:25:06 +0100 (Sun, 14 Feb 2010)
New Revision: 10288

Modified:
   gnunet/src/util/network.c
Log:
fix MinGW, more precise type/error code handling

Modified: gnunet/src/util/network.c
===================================================================
--- gnunet/src/util/network.c   2010-02-13 13:48:15 UTC (rev 10287)
+++ gnunet/src/util/network.c   2010-02-13 23:25:06 UTC (rev 10288)
@@ -38,7 +38,11 @@
 
 struct GNUNET_NETWORK_Handle
 {
+#ifndef MINGW
   int fd;
+#else
+  SOCKET fd;
+#endif
 };
 
 
@@ -57,7 +61,7 @@
 
 #ifdef WINDOWS
   /**
-   * Linked list of handles 
+   * Linked list of handles
    */
   struct GNUNET_CONTAINER_SList *handles;
 #endif
@@ -368,12 +372,16 @@
   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;
 }
 
 /**





reply via email to

[Prev in Thread] Current Thread [Next in Thread]