fa4a80
build.sh:buildp_ast(): correctly call rtl_kill_tree().
@@ -3,16 +3,16 @@
|
|
3
3
|
#
|
4
4
|
|
5
5
|
buildp_ast() {
|
6
|
-
local _param="${1}"
|
6
|
+
local _param="${1}" RTL_KILL_TREE_PIDS="";
|
7
7
|
if [ "${_param}" = "abort" ]; then
|
8
8
|
rtl_log_msg failexit "Build aborted.";
|
9
9
|
fi;
|
10
10
|
if [ -n "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}" ]; then
|
11
11
|
rtl_fileop rm "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}";
|
12
12
|
fi;
|
13
|
-
if rtl_kill_tree
|
14
|
-
&& [ -n "${
|
15
|
-
rtl_log_msg vnfo "Killed PIDs ${
|
13
|
+
if rtl_kill_tree "${$}" "TERM"\
|
14
|
+
&& [ -n "${RTL_KILL_TREE_PIDS}" ]; then
|
15
|
+
rtl_log_msg vnfo "Killed PIDs ${RTL_KILL_TREE_PIDS}";
|
16
16
|
fi;
|
17
17
|
};
|
18
18
|
|
@@ -75,13 +75,17 @@ rtl_head() {
|
|
75
75
|
};
|
76
76
|
|
77
77
|
rtl_kill_tree() {
|
78
|
-
local _pid="${1}" _signal
|
79
|
-
|
80
|
-
|
81
|
-
|
78
|
+
local _pid="${1}" _signal="${2:-TERM}" _pid_child="" _pids="";
|
79
|
+
if _pids="$(pgrep -P "${_pid}")"\
|
80
|
+
&& [ -n "${_pids}" ]; then
|
81
|
+
for _pid_child in ${_pids}; do
|
82
|
+
rtl_kill_tree "${_pid_child}" "${_signal}";
|
82
83
|
done;
|
83
|
-
|
84
|
-
|
84
|
+
fi;
|
85
|
+
if [ "${_pid:-0}" -ne "${$}" ]\
|
86
|
+
&& kill "-${_signal}" "${_pid}" 2>/dev/null; then
|
87
|
+
RTL_KILL_TREE_PIDS="$(rtl_lconcat "${RTL_KILL_TREE_PIDS}" "${_pid}")";
|
88
|
+
fi;
|
85
89
|
};
|
86
90
|
|
87
91
|
rtl_run_cmd_unsplit() {
|