not block so long
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 14 Dec 2006 16:35:03 +0000 (16:35 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Thu, 14 Dec 2006 16:35:03 +0000 (16:35 +0000)
lib/base/console.cpp

index 75c6162..3f73fba 100644 (file)
@@ -281,6 +281,7 @@ void eConsoleAppContainer::closePipes()
 
 void eConsoleAppContainer::readyRead(int what)
 {
+       bool hungup = what & eSocketNotifier::Hungup;
        if (what & (eSocketNotifier::Priority|eSocketNotifier::Read))
        {
 //             eDebug("what = %d");
@@ -292,9 +293,11 @@ void eConsoleAppContainer::readyRead(int what)
                                eDebug("%d = %c (%02x)", i, buf[i], buf[i] );*/
                        buf[rd]=0;
                        /*emit*/ dataAvail(buf);
+                       if (!hungup)
+                               break;
                }
        }
-       if (what & eSocketNotifier::Hungup)
+       if (hungup)
        {
                eDebug("child has terminated");
                closePipes();