From a9717545551aa7d6e3e05e629b8142a1cd669a77 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz Date: Feb 29 2020 14:27:27 +0000 Subject: build.sh:buildp_ast(): break from rtl_kill_tree() loop after 8 attempts. build.sh:buildp_ast(): list killed PIDs on single line. --- diff --git a/build.sh b/build.sh index e4ad9b2..5c4f614 100755 --- a/build.sh +++ b/build.sh @@ -3,22 +3,25 @@ # buildp_ast() { - local _param="${1}" RTL_KILL_TREE_PIDS=""; + local _param="${1}" _pids="" _pids_niter=0 RTL_KILL_TREE_PIDS=""; if [ "${_param}" = "abort" ]; then rtl_log_msg failexit "Build aborted."; fi; if [ -n "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}" ]; then rtl_fileop rm "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}"; fi; - while true; do - RTL_KILL_TREE_PIDS=""; - if rtl_kill_tree "${$}" "TERM"\ - && [ -n "${RTL_KILL_TREE_PIDS}" ]; then - rtl_log_msg vnfo "Killed PIDs ${RTL_KILL_TREE_PIDS}"; - else + while [ "${_pids_niter}" -lt 8 ]; do + _pids="$(rtl_lconcat "${_pids}" "${RTL_KILL_TREE_PIDS}")"; RTL_KILL_TREE_PIDS=""; + if ! rtl_kill_tree "${$}" "TERM"\ + || [ -z "${RTL_KILL_TREE_PIDS}" ]; then break; + else + : $((_pids_niter+=1)); fi; done; + if [ -n "${_pids}" ]; then + rtl_log_msg vnfo "Killed PIDs ${_pids}"; + fi; }; buildp_dispatch_fail_pkg() {