Spawn.vala
[gitlive] / Spawn.vala
index a25c2da..363fb48 100644 (file)
@@ -426,9 +426,7 @@ public class Spawn : Object
     {
         string prop = (ch == this.out_ch) ? "output" : "stderr";
        // print("prop: " + prop);
-        if (this.pid < 0) {
-            return; // spawn complete + closed... can't read any more.
-        }
+        
         
         //print(JSON.stringify(ch, null,4));
         while (true) {
@@ -436,6 +434,11 @@ public class Spawn : Object
             size_t term_pos;
             size_t len;
             IOStatus status;
+            
+            if (this.pid < 0) {
+                return false; // spawn complete + closed... can't read any more.
+            }
+            
             try {
                                var cond = ch.get_buffer_condition();
                                if ((cond & GLib.IOCondition.ERR) > 0) {