X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b74865fa61c17c45f65d9f59befc52516e41c9c7..d2d0adc7765dfe904f0f7e97d85a2638c934a7d6:/src/unix/gsocket.cpp?ds=sidebyside diff --git a/src/unix/gsocket.cpp b/src/unix/gsocket.cpp index 97eeb0153b..bf29390d94 100644 --- a/src/unix/gsocket.cpp +++ b/src/unix/gsocket.cpp @@ -39,6 +39,10 @@ #include #include +#ifdef HAVE_SYS_SELECT_H +# include +#endif + #ifdef __VMS__ #include 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))