aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-11-04 22:49:49 +0100
committerLudovic Courtès <ludo@gnu.org>2019-11-04 23:35:32 +0100
commitaf73beeba1fc9effab60b11aea1d7ed8c24e7367 (patch)
tree4e3d3bfee11624d06683521cd4930f0403018efb
parent32793c09ffd07e8ca54fc5c3d992454b39add506 (diff)
downloadpatches-af73beeba1fc9effab60b11aea1d7ed8c24e7367.tar
patches-af73beeba1fc9effab60b11aea1d7ed8c24e7367.tar.gz
daemon: Unregister build hook from the worker's children upon build failure.
Fixes <https://bugs.gnu.org/38062>. This is a followup to ada9a19a2dca74feafcf24df1152abd685d4142f. * nix/libstore/build.cc (DerivationGoal::killChild): Add conditional call to 'worker.childTerminated' for 'hook->pid'.
-rw-r--r--nix/libstore/build.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index 74cd05417f..c4fc87746a 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -947,6 +947,11 @@ void DerivationGoal::killChild()
assert(pid == -1);
}
+ /* If there was a build hook involved, remove it from the worker's
+ children. */
+ if (hook && hook->pid != -1) {
+ worker.childTerminated(hook->pid);
+ }
hook.reset();
}