summaryrefslogtreecommitdiffstats
path: root/third_party/heimdal/tests/kdc/leaks-kill.sh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/heimdal/tests/kdc/leaks-kill.sh')
-rw-r--r--third_party/heimdal/tests/kdc/leaks-kill.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/third_party/heimdal/tests/kdc/leaks-kill.sh b/third_party/heimdal/tests/kdc/leaks-kill.sh
new file mode 100644
index 0000000..1474bdd
--- /dev/null
+++ b/third_party/heimdal/tests/kdc/leaks-kill.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+name=$1
+pid=$2
+
+kill $pid
+set -- .
+while kill -0 $pid 2>/dev/null
+do
+ set -- "$@" "."
+ if [ $# -gt 4 ]
+ then
+ kill kill -9 $pid 2> /dev/null
+ break
+ fi
+ sleep 1
+done
+
+set -- .
+while kill -0 $pid 2>/dev/null
+do
+ set -- "$@" "."
+ if [ $# -gt 4 ]; then exit 1; fi
+ sleep 1
+done
+
+exit 0