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:
@@ -32,6 +32,7 @@
|
|||||||
#include "wx/splitter.h"
|
#include "wx/splitter.h"
|
||||||
#include "wx/dcscreen.h"
|
#include "wx/dcscreen.h"
|
||||||
#include "wx/settings.h"
|
#include "wx/settings.h"
|
||||||
|
#include "wx/log.h"
|
||||||
|
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSplitterWindow, wxWindow)
|
IMPLEMENT_DYNAMIC_CLASS(wxSplitterWindow, wxWindow)
|
||||||
IMPLEMENT_DYNAMIC_CLASS(wxSplitterEvent, wxCommandEvent)
|
IMPLEMENT_DYNAMIC_CLASS(wxSplitterEvent, wxCommandEvent)
|
||||||
|
@@ -915,6 +915,7 @@ GSocketError _GSocket_Input_Timeout(GSocket *socket)
|
|||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
fd_set readfds;
|
fd_set readfds;
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* Linux select() will overwrite the struct on return */
|
/* Linux select() will overwrite the struct on return */
|
||||||
tv.tv_sec = (socket->m_timeout / 1000);
|
tv.tv_sec = (socket->m_timeout / 1000);
|
||||||
@@ -924,8 +925,20 @@ GSocketError _GSocket_Input_Timeout(GSocket *socket)
|
|||||||
{
|
{
|
||||||
FD_ZERO(&readfds);
|
FD_ZERO(&readfds);
|
||||||
FD_SET(socket->m_fd, &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;
|
socket->m_error = GSOCK_TIMEDOUT;
|
||||||
return GSOCK_TIMEDOUT;
|
return GSOCK_TIMEDOUT;
|
||||||
}
|
}
|
||||||
@@ -941,6 +954,7 @@ GSocketError _GSocket_Output_Timeout(GSocket *socket)
|
|||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
fd_set writefds;
|
fd_set writefds;
|
||||||
|
int ret;
|
||||||
|
|
||||||
/* Linux select() will overwrite the struct on return */
|
/* Linux select() will overwrite the struct on return */
|
||||||
tv.tv_sec = (socket->m_timeout / 1000);
|
tv.tv_sec = (socket->m_timeout / 1000);
|
||||||
@@ -950,8 +964,20 @@ GSocketError _GSocket_Output_Timeout(GSocket *socket)
|
|||||||
{
|
{
|
||||||
FD_ZERO(&writefds);
|
FD_ZERO(&writefds);
|
||||||
FD_SET(socket->m_fd, &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;
|
socket->m_error = GSOCK_TIMEDOUT;
|
||||||
return GSOCK_TIMEDOUT;
|
return GSOCK_TIMEDOUT;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user