summaryrefslogtreecommitdiff
path: root/pump.in
diff options
context:
space:
mode:
authorfergus.henderson <fergushenderson@users.noreply.github.com>2008-06-03 03:45:08 +0000
committerfergus.henderson <fergushenderson@users.noreply.github.com>2008-06-03 03:45:08 +0000
commitf7f852668d11e537d479be38d39b687ee429f07e (patch)
tree6905113438b316ae734556a276053c81d1fb830a /pump.in
parent8d257fc418a25224bc1950c0794596e9088c3202 (diff)
downloaddistcc-git-f7f852668d11e537d479be38d39b687ee429f07e.tar.gz
Fix a bug in the pump script where it wasn't waiting for the include
server to terminate before exiting. Reviewers: Nils Klarlund, Craig Silverstein
Diffstat (limited to 'pump.in')
-rwxr-xr-xpump.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/pump.in b/pump.in
index 987a41f..93dd740 100755
--- a/pump.in
+++ b/pump.in
@@ -345,6 +345,12 @@ ShutDown() {
ps -p "$include_server_pid" > /dev/null; then
echo '__________Shutting down distcc-pump include server'
kill $include_server_pid
+ # Wait until it's really dead. We need to do this because the
+ # include server may produce output after receiving SIGTERM.
+ # Note that while 'sleep 0.01' is relying on a feature of GNU sleep,
+ # that's OK; on systems that don't support it, it's effectively the
+ # same as 'sleep 0', i.e. we'll just busy-wait rather than sleeping.
+ while kill -0 $include_server_pid; do sleep 0.01; done >/dev/null 2>&1
fi
if [ -f "$include_server_stdout" ]; then