]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/gsocket.cpp
Added URL support to attribute objects and to wxRichTextCtrl,
[wxWidgets.git] / src / unix / gsocket.cpp
index 97eeb0153b226d762a844b85c11b3fb9f05b2aa7..bf29390d94eda805ca845d63e90d887b405cf679 100644 (file)
 #include <netdb.h>
 #include <sys/ioctl.h>
 
+#ifdef HAVE_SYS_SELECT_H
+#   include <sys/select.h>
+#endif
+
 #ifdef __VMS__
 #include <socket.h>
 struct sockaddr_un
@@ -1084,7 +1088,13 @@ int GSocket::Read(char *buffer, int size)
      * socket only if errno does _not_ indicate that there may be more data to read.
      */
     if (ret == 0)
+    {
       m_error = GSOCK_IOERR;
+      m_detected = GSOCK_LOST_FLAG;
+      Close();
+      // Signal an error for return
+      return -1;
+    }
     else if (ret == -1)
     {
       if ((errno == EWOULDBLOCK) || (errno == EAGAIN))