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) => { });
+ }
}
* result is applied to object properties (eg. '?' or 'stderr')
* @returns {Object} self.
*/
- public void run(unowned SpawnFinish? finished_cb) throws SpawnError, GLib.SpawnError, GLib.IOChannelError
+ public void run(unowned SpawnFinish finished_cb) throws SpawnError, GLib.SpawnError, GLib.IOChannelError
{
//but... let's close input now..
this.in_ch.shutdown(true);
this.in_ch = null;
-
+
} catch (Error e) {
this.tidyup();
//if (this.cfg.debug) {
//
// }
- this.ctx = new MainLoop ();
+ this.ctx = MainLoop ();
this.ctx.run(); // wait fore exit?
//print("main_loop done!");
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...
}