From fbf0b2fa45c883f1f5e0c8f5397fcf62a4df9207 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 19 Dec 2012 11:47:42 +0100 Subject: Kill the build hook rather than shutting it down cleanly Waiting for the hook to shut down cleanly sometimes seems to lead to hangs. --- src/libstore/build.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/libstore') diff --git a/src/libstore/build.cc b/src/libstore/build.cc index ce87eaed2..08dfbd284 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(); } -- cgit v1.2.3