]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/gsocket.cpp
fixed two icc warnings about local variables hiding parameters
[wxWidgets.git] / src / unix / gsocket.cpp
index 862e94c98992c17add9abbcd1eb99e65af50dd41..d9a83d361e551fc25f17691b03dcfe661216942b 100644 (file)
@@ -722,7 +722,8 @@ GSocketError GSocket::Connect(GSocketStream stream)
    * connection _if_ blocking sockets are being used.
    * If connect above returns 0, we are already connected and need to make the
    * call to Enable_Events now.  
-
+   */
+  
   if (m_non_blocking || ret == 0)
   {
     gs_gui_functions->Enable_Events(this);
@@ -868,23 +869,25 @@ int GSocket::Read(char *buffer, int size)
   Disable(GSOCK_INPUT);
 
   /* If the socket is blocking, wait for data (with a timeout) */
-  if (Input_Timeout() == GSOCK_TIMEDOUT)
-    /* We no longer return here immediately, otherwise socket events would not be re-enabled! */
+  if (Input_Timeout() == GSOCK_TIMEDOUT) {
+    m_error = GSOCK_TIMEDOUT;
+    /* Don't return here immediately, otherwise socket events would not be
+     * re-enabled! */
     ret = -1;
+  }
   else {
     /* Read the data */
     if (m_stream)
       ret = Recv_Stream(buffer, size);
     else
       ret = Recv_Dgram(buffer, size);
-  }
 
-  if (ret == -1)
-  {
-    if ((errno == EWOULDBLOCK) || (errno == EAGAIN))
-      m_error = GSOCK_WOULDBLOCK;
-    else
-      m_error = GSOCK_IOERR;
+    if (ret == -1) {
+      if ((errno == EWOULDBLOCK) || (errno == EAGAIN))
+        m_error = GSOCK_WOULDBLOCK;
+      else
+        m_error = GSOCK_IOERR;
+    }
   }
 
   /* Enable events again now that we are done processing */