about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index ce87eaed2f31..08dfbd2840e6 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -710,13 +710,7 @@ HookInstance::HookInstance()
 HookInstance::~HookInstance()
 {
     try {
-        /* Cleanly shut down the hook by closing its stdin if it's not
-           already building.  Otherwise pid's destructor will kill
-           it. */
-        if (pid != -1 && toHook.writeSide != -1) {
-            toHook.writeSide.close();
-            pid.wait(true);
-        }
+        pid.kill();
     } catch (...) {
         ignoreException();
     }