Spawn.vala
[gitlive] / Spawn.vala
index c9e67f5..771a5df 100644 (file)
@@ -156,7 +156,9 @@ public class Spawn : Object
         if (this.cfg.args.length < 0) {
             throw new SpawnError.NO_ARGS("No arguments");
         }
-        this.run((res, output) => { });
+        if (!this.cfg.async) {
+               this.run((res, output) => { });
+        }
     
     }
 
@@ -322,7 +324,7 @@ public class Spawn : Object
                     //but... let's close input now..
                     this.in_ch.shutdown(true);
                     this.in_ch = null;
-                     
+                    
                     
                 } catch (Error e) {
                     this.tidyup();
@@ -346,7 +348,7 @@ public class Spawn : Object
              //if (this.cfg.debug) {
              //  
              // }
-               this.ctx = new MainLoop ();
+               this.ctx =   MainLoop ();
             this.ctx.run(); // wait fore exit?
             
             //print("main_loop done!");
@@ -361,7 +363,7 @@ public class Spawn : Object
                        errstr += this.output.length > 0 ? "\n" : "";
                        errstr += this.stderr;
                        //print("Throwing execute error:%s\n", errstr);
-            throw new SpawnError.EXECUTE_ERROR(errstr);
+            throw   SpawnError.EXECUTE_ERROR(errstr);
             //this.toString = function() { return this.stderr; };
             ///throw new Exception this; // we throw self...
         }