]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/gsocket.c
fix for (too big) combobox height
[wxWidgets.git] / src / msw / gsocket.c
index fca515b42065c0bb7ca1e12e9f1e97ba8e77caff..66dc5acfc64060b81381a7ecfb72c664d3ae57fb 100644 (file)
 #include <ctype.h>
 #include <winsock.h>
 
+/* if we use configure for MSW SOCKLEN_T will be already defined */
+#ifndef SOCKLEN_T
 #define SOCKLEN_T  int
+#endif
+
 #define CLASSNAME  "_GSocket_Internal_Window_Class"
 #define WINDOWNAME "_GSocket_Internal_Window_Name"
 
@@ -768,7 +772,7 @@ GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags)
 {
   assert(socket != NULL);
 
-  return (flags & socket->m_detected);
+  return flags & socket->m_detected;
 }
 
 /* Attributes */
@@ -1030,17 +1034,14 @@ GSocketError _GSocket_Connect_Timeout(GSocket *socket)
   fd_set writefds;
   fd_set exceptfds;
 
-  if (!socket->m_non_blocking)
+  FD_ZERO(&writefds);
+  FD_ZERO(&exceptfds);
+  FD_SET(socket->m_fd, &writefds);
+  FD_SET(socket->m_fd, &exceptfds);
+  if (select(0, NULL, &writefds, &exceptfds, &socket->m_timeout) == 0)
   {
-    FD_ZERO(&writefds);
-    FD_ZERO(&exceptfds);
-    FD_SET(socket->m_fd, &writefds);
-    FD_SET(socket->m_fd, &exceptfds);
-    if (select(0, NULL, &writefds, &exceptfds, &socket->m_timeout) == 0)
-    {
-      socket->m_error = GSOCK_TIMEDOUT;
-      return GSOCK_TIMEDOUT;
-    }
+    socket->m_error = GSOCK_TIMEDOUT;
+    return GSOCK_TIMEDOUT;
   }
   if (!FD_ISSET(socket->m_fd, &writefds))
   {