Even more printfs in GSocket,

Copmile fix for splitter.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6683 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2000-03-14 13:53:34 +00:00
parent ee453a161f
commit a8a0b892df
2 changed files with 29 additions and 2 deletions

View File

@@ -32,6 +32,7 @@
#include "wx/splitter.h"
#include "wx/dcscreen.h"
#include "wx/settings.h"
#include "wx/log.h"
IMPLEMENT_DYNAMIC_CLASS(wxSplitterWindow, wxWindow)
IMPLEMENT_DYNAMIC_CLASS(wxSplitterEvent, wxCommandEvent)

View File

@@ -915,6 +915,7 @@ GSocketError _GSocket_Input_Timeout(GSocket *socket)
{
struct timeval tv;
fd_set readfds;
int ret;
/* Linux select() will overwrite the struct on return */
tv.tv_sec = (socket->m_timeout / 1000);
@@ -924,8 +925,20 @@ GSocketError _GSocket_Input_Timeout(GSocket *socket)
{
FD_ZERO(&readfds);
FD_SET(socket->m_fd, &readfds);
if (select(socket->m_fd + 1, &readfds, NULL, NULL, &tv) == 0)
ret = select(socket->m_fd + 1, &readfds, NULL, NULL, &tv);
if (ret == 0)
{
printf( "GSocket_Input_Timeout, select returned 0\n" );
socket->m_error = GSOCK_TIMEDOUT;
return GSOCK_TIMEDOUT;
}
if (ret == -1)
{
printf( "GSocket_Input_Timeout, select returned -1\n" );
if (errno == EBADF) printf( "Invalid file descriptor\n" );
if (errno == EINTR) printf( "A non blocked signal was caught\n" );
if (errno == EINVAL) printf( "The highest number descriptor is negative\n" );
if (errno == ENOMEM) printf( "Not enough memory\n" );
socket->m_error = GSOCK_TIMEDOUT;
return GSOCK_TIMEDOUT;
}
@@ -941,6 +954,7 @@ GSocketError _GSocket_Output_Timeout(GSocket *socket)
{
struct timeval tv;
fd_set writefds;
int ret;
/* Linux select() will overwrite the struct on return */
tv.tv_sec = (socket->m_timeout / 1000);
@@ -950,8 +964,20 @@ GSocketError _GSocket_Output_Timeout(GSocket *socket)
{
FD_ZERO(&writefds);
FD_SET(socket->m_fd, &writefds);
if (select(socket->m_fd + 1, NULL, &writefds, NULL, &tv) == 0)
ret = select(socket->m_fd + 1, NULL, &writefds, NULL, &tv);
if (ret == 0)
{
printf( "GSocket_Output_Timeout, select returned 0\n" );
socket->m_error = GSOCK_TIMEDOUT;
return GSOCK_TIMEDOUT;
}
if (ret == -1)
{
printf( "GSocket_Output_Timeout, select returned -1\n" );
if (errno == EBADF) printf( "Invalid file descriptor\n" );
if (errno == EINTR) printf( "A non blocked signal was caught\n" );
if (errno == EINVAL) printf( "The highest number descriptor is negative\n" );
if (errno == ENOMEM) printf( "Not enough memory\n" );
socket->m_error = GSOCK_TIMEDOUT;
return GSOCK_TIMEDOUT;
}