git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16660
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxPipeInputStream(int fd) : wxFileInputStream(fd) { }
// return TRUE if the pipe is still opened
wxPipeInputStream(int fd) : wxFileInputStream(fd) { }
// return TRUE if the pipe is still opened
- bool IsOpened() const { return TRUE; } // TODO
+ bool IsOpened() const { return !Eof(); }
// return TRUE if we have anything to read, don't block
bool IsAvailable() const;
// return TRUE if we have anything to read, don't block
bool IsAvailable() const;
bool wxPipeInputStream::IsAvailable() const
{
if ( m_lasterror == wxSTREAM_EOF )
bool wxPipeInputStream::IsAvailable() const
{
if ( m_lasterror == wxSTREAM_EOF )
// check if there is any input available
struct timeval tv;
// check if there is any input available
struct timeval tv;
default:
wxFAIL_MSG(_T("unexpected select() return value"));
// still fall through
case 1:
default:
wxFAIL_MSG(_T("unexpected select() return value"));
// still fall through
case 1:
- // input available
- return TRUE;
+ // input available -- or maybe not, as select() returns 1 when a
+ // read() will complete without delay, but it could still not read
+ // anything
+ return !Eof();