]> git.saurik.com Git - wxWidgets.git/commitdiff
polling child process IO seems to work now
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 21 Aug 2002 19:49:34 +0000 (19:49 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 21 Aug 2002 19:49:34 +0000 (19:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/unix/utilsunx.cpp

index 6fe5a0b5f74e37b7b2f78739298e162161174e6d..0b60c5214cff53d96541e4182b87edfc200e458d 100644 (file)
@@ -363,7 +363,7 @@ public:
     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;
@@ -372,7 +372,7 @@ public:
 bool wxPipeInputStream::IsAvailable() const
 {
     if ( m_lasterror == wxSTREAM_EOF )
-        return TRUE;
+        return FALSE;
 
     // check if there is any input available
     struct timeval tv;
@@ -391,15 +391,17 @@ bool wxPipeInputStream::IsAvailable() const
             // fall through
 
         case 0:
-            return TRUE;
+            return FALSE;
 
         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();
     }
 }