X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=src%2FSpawn.vala;h=d3b9428b9f96ef5d841aed9c3892683eb9bdfc26;hb=fc49f865ff0b406b1fb2313e84cf3edb8536727b;hp=08415ef4ee9c39057f60f07654119af3ab94a932;hpb=10499e5da880b5bf1d0bd3d25dbb926f20acc760;p=app.Builder.js diff --git a/src/Spawn.vala b/src/Spawn.vala index 08415ef4e..d3b9428b9 100644 --- a/src/Spawn.vala +++ b/src/Spawn.vala @@ -154,7 +154,23 @@ public class Spawn : Object GLib.debug("cd %s; %s" , this.cwd , string.joinv(" ", this.args)); - + if (this.detach) { + Process.spawn_async_with_pipes ( + this.cwd, + this.args, + this.env.length > 0 ? this.env : null, + SpawnFlags.SEARCH_PATH | SpawnFlags.DO_NOT_REAP_CHILD, + null, + out this.pid); + ChildWatch.add (this.pid, (pid, status) => { + // Triggered when the child indicated by child_pid exits + Process.close_pid (pid); + + }); + + return; + + } Process.spawn_async_with_pipes ( this.cwd, this.args, @@ -167,9 +183,7 @@ public class Spawn : Object out standard_error); // stdout: - if (this.detach) { - return; - } + //print(JSON.stringify(gret)); @@ -357,7 +371,7 @@ public class Spawn : Object */ private bool read(IOChannel ch) { - string prop = (ch == this.out_ch) ? "output" : "stderr"; + // string prop = (ch == this.out_ch) ? "output" : "stderr"; // print("prop: " + prop);