1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-11-02 16:44:45 +00:00

use kj's onChildExit mechanism

This reduces code and allows for more idiosyncratic use of Promises.
Requires latest capnproto git.

Part of #49 refactor
This commit is contained in:
Oliver Giles
2018-08-03 14:36:24 +03:00
parent 4ffc22c657
commit a81492e5bc
12 changed files with 33 additions and 59 deletions

View File

@@ -139,7 +139,10 @@ void Run::addEnv(std::string path) {
void Run::abort() {
// clear all pending scripts
std::queue<Script>().swap(scripts);
kill(-current_pid, SIGTERM);
// if the Maybe is empty, wait() was already called on this process
KJ_IF_MAYBE(p, current_pid) {
kill(-*p, SIGTERM);
}
}
void Run::reaped(int status) {