diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-06-25T15·36+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-06-25T15·36+0000 |
commit | b113edeab780216b0590045b932be685d1399e9b (patch) | |
tree | 32c0e6e0006c211b43f91aad8529cff6c424306d /src/libutil/util.cc | |
parent | e4883211f9482ec3255bd4e682635493e03466ca (diff) |
* A flag `--keep-going / -k' to keep building goals if one fails, as
much as possible. (This is similar to GNU Make's `-k' flag.) * Refactoring to implement this: previously we just bombed out when a build failed, but now we have to clean up. In particular this means that goals must be freed quickly --- they shouldn't hang around until the worker exits. So the worker now maintains weak pointers in order not to prevent garbage collection. * Documented the `-k' and `-j' flags.
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r-- | src/libutil/util.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 5511b27c9726..43ec2b9f3be8 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -492,20 +492,19 @@ void Pid::kill() { if (pid == -1) return; - printMsg(lvlError, format("killing child process %1%") % pid); + printMsg(lvlError, format("killing process %1%") % pid); /* Send a KILL signal to the child. If it has its own process group, send the signal to every process in the child process group (which hopefully includes *all* its children). */ if (::kill(separatePG ? -pid : pid, SIGKILL) != 0) - printMsg(lvlError, format("killing process %1%") % pid); - else { - /* Wait until the child dies, disregarding the exit status. */ - int status; - while (waitpid(pid, &status, 0) == -1) - if (errno != EINTR) printMsg(lvlError, - format("waiting for process %1%") % pid); - } + printMsg(lvlError, (SysError(format("killing process %1%") % pid).msg())); + + /* Wait until the child dies, disregarding the exit status. */ + int status; + while (waitpid(pid, &status, 0) == -1) + if (errno != EINTR) printMsg(lvlError, + (SysError(format("waiting for process %1%") % pid).msg())); pid = -1; } |