From 4d73e2e893850d032770373b026854228c61dc8e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Aug 2014 17:27:45 +0200 Subject: [PATCH] Get rid of "killing " message for unused build hooks --- src/libstore/build.cc | 2 +- src/libutil/util.cc | 5 +++-- src/libutil/util.hh | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index d73504a35..e3d96d931 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -623,7 +623,7 @@ HookInstance::HookInstance() HookInstance::~HookInstance() { try { - pid.kill(); + pid.kill(true); } catch (...) { ignoreException(); } diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 44087d58e..ed283fb8c 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -740,11 +740,12 @@ Pid::operator pid_t() } -void Pid::kill() +void Pid::kill(bool quiet) { if (pid == -1 || pid == 0) return; - printMsg(lvlError, format("killing process %1%") % pid); + if (!quiet) + printMsg(lvlError, format("killing process %1%") % pid); /* Send the requested signal to the child. If it has its own process group, send the signal to every process in the child diff --git a/src/libutil/util.hh b/src/libutil/util.hh index ade52c354..5f2d95339 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -253,7 +253,7 @@ public: ~Pid(); void operator =(pid_t pid); operator pid_t(); - void kill(); + void kill(bool quiet = false); int wait(bool block); void setSeparatePG(bool separatePG); void setKillSignal(int signal);