summaryrefslogtreecommitdiffstats
path: root/jack/etc
diff options
context:
space:
mode:
authorJean-Philippe Lesot <jplesot@google.com>2015-04-01 14:40:08 +0200
committerJean-Philippe Lesot <jplesot@google.com>2015-04-01 14:40:08 +0200
commit98efb7bb82b1a2a3c5ada01c7b2265ecf408db82 (patch)
tree02dbc72446bf43d4a6bc70c0c357e0978bc51a68 /jack/etc
parent8d3de6f6064425abbd66232fbf51d91838e5ab65 (diff)
downloadtoolchain_jack-98efb7bb82b1a2a3c5ada01c7b2265ecf408db82.zip
toolchain_jack-98efb7bb82b1a2a3c5ada01c7b2265ecf408db82.tar.gz
toolchain_jack-98efb7bb82b1a2a3c5ada01c7b2265ecf408db82.tar.bz2
Rework finally in Jack simple server, add a retry counter in script
Change-Id: Id9a8a08e27d923a347cc18fb2b861c1963f3f858
Diffstat (limited to 'jack/etc')
-rwxr-xr-xjack/etc/jack10
1 files changed, 8 insertions, 2 deletions
diff --git a/jack/etc/jack b/jack/etc/jack
index 1a070e8..3a69eb6 100755
--- a/jack/etc/jack
+++ b/jack/etc/jack
@@ -57,7 +57,7 @@ mkfifo "$JACK_ERR"
touch "$JACK_CLI" "$JACK_EXIT"
# Try to cleanup if interrupted
-trap 'kill -9 $PID_OUT $PID_ERR; wait $PID_OUT $PID_ERR 2>/dev/null; exit 255' SIGHUP SIGINT SIGQUIT SIGTERM ERR
+trap 'kill -9 $PID_OUT $PID_ERR 2>/dev/null; wait $PID_OUT $PID_ERR 2>/dev/null; exit 255' SIGHUP SIGINT SIGQUIT SIGTERM ERR
# Redirect output and error
cat <"$JACK_OUT" >&1 &
PID_OUT=$!
@@ -116,7 +116,13 @@ while true; do
fi
else
# In case of partial, timeout, empty, network error, let's retry
- sleep 1
+ if [ $RETRY -eq 0 ]; then
+ echo "Communication error with server, error code " $CURL_CODE
+ kill -QUIT $$
+ else
+ let RETRY=RETRY-1
+ sleep 1
+ fi
fi
done