Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@ryansg.com>2020-01-21 11:40:13 -0500
committerMike Gerwitz <mike.gerwitz@ryansg.com>2020-01-21 11:40:14 -0500
commit0718d80257bc64f182d52e6d86d8b0a9e6e942b8 (patch)
treea497e1ff577def9305eb474d1c17b1ebc7ac36a7 /bin
parent61fe1af1cbbe05a8b472e1ee3656ec280f46becb (diff)
downloadtame-0718d80257bc64f182d52e6d86d8b0a9e6e942b8.tar.gz
tame-0718d80257bc64f182d52e6d86d8b0a9e6e942b8.tar.bz2
tame-0718d80257bc64f182d52e6d86d8b0a9e6e942b8.zip
bin/tamed: Fail without explicit DONE
We want to fail e.g. on a JVM crash.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tame5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/tame b/bin/tame
index b2cae7b..c91c7f7 100755
--- a/bin/tame
+++ b/bin/tame
@@ -26,6 +26,7 @@ declare -ri EX_STALLED=2 # runner stalled and could not recover
declare -ri EX_NORUN=3 # no available runners
declare -ri EX_DLOCK=4 # failed to get a lock to start tamed
declare -ri EX_BLOCK=5 # failed to get a lock for busy runner check
+declare -ri EX_NODONE=6 # tamed did not provide a DONE with exit code
declare -ri EX_USAGE=64 # incorrect usage; sysexits.h
# maximum amount of time in seconds to wait for runner to ack
@@ -111,6 +112,10 @@ command-runner()
echo "$line"
done < "$base/1"
+
+ # We should have returned as soon as we received DONE. If this was not
+ # provided, then something probably went wrong (e.g. JVM crash).
+ return "$EX_NODONE"
}