Spawn.vala
[gitlive] / Spawn.vala
index 0def9df..4e46612 100644 (file)
@@ -223,27 +223,28 @@ public class Spawn : Object
        //print(JSON.stringify(gret));    
          
         if (this.cfg.debug) {
-            stdout.print("PID: %d" ,this.pid);
+            
+            stdout.printf("PID: %d" ,this.pid);
         }
          
         ChildWatch.add (this.pid, (w_pid, result) => {
            
-           this.result = result;
-            if (_this.debug) {
-                print("child_watch_add : result: " + result);
+            this.result = result;
+            if (this.cfg.debug) {
+                stdout.printf("child_watch_add : result:%d ", result);
             }
-           
+           
             this.read(this.out_ch);
             this.read(this.err_ch);
             
-                       
+            
             Process.close_pid(this.pid);
             this.pid = -1;
             if (this.ctx) {
                 this.ctx.quit();
             }
             this.tidyup();
-           //print("DONE TIDYUP");
+        //print("DONE TIDYUP");
             if (this.cfg.finish) {
                 this.cfg.finish(this.result);
             }
@@ -377,8 +378,8 @@ public class Spawn : Object
         
         //print("write_char retunred:" + JSON.stringify(res) +  ' ' +JSON.stringify(ret)  );
         
-            if (res != GLib.IOStatus.NORMAL) {
-                throw "Write failed";
+        if (res != GLib.IOStatus.NORMAL) {
+            throw "Write failed";
         }
         //return ret.value;
         return str.length;
@@ -400,8 +401,8 @@ public class Spawn : Object
         //print(JSON.stringify(ch, null,4));
         while (true) {
  
-            var x =   {};
-            var status = ch.read_line( x);
+           
+            var status = ch.read_line( str_return, );
             // print('status: '  +JSON.stringify(status));
             // print(JSON.stringify(x));
              switch(status) {