# # # patch "monotone.cc" # from [2034fc498cf2f2a5095b1bc4f6a55ac6e59ce551] # to [8c9617d68b515df99769b27e2826cef8b063b811] # ============================================================ --- monotone.cc 2034fc498cf2f2a5095b1bc4f6a55ac6e59ce551 +++ monotone.cc 8c9617d68b515df99769b27e2826cef8b063b811 @@ -23,10 +23,6 @@ #include #include -// For future reference: CreateProcess and WaitForMultipleObjects on win32 -// to replace fork/exec and select? -// Put in a 'class Platform {};'? - inline int max(int a, int b) {return (a>b)?a:b;} monotone::monotone(): pid(0), dir(".") @@ -79,11 +75,7 @@ bool last = process_packet(tempstr, output_std); if (last) { - busy = false; - signal_done.emit(); - signal_done.clear(); - output_std.clear(); - output_err.clear(); + child_exited(0, 0); } return true; } @@ -151,9 +143,9 @@ monotone::child_exited(Glib::Pid p, int c) { pid = 0; - busy = false; - std::cerr< const & args) { - mode = STDIO; - if (!pid) + if (!pid || mode != STDIO) start(); + mode = STDIO; busy = true; std::ostringstream s; s << cmd.size() <<":"< & out) { out.clear(); + waitfor(); std::vector args; command("inventory", args); signal_done.connect(sigc::bind(sigc::ptr_fun(&process_inventory), &output_std, &out));