We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 134508b + 0ceef7b commit 0c8f7fcCopy full SHA for 0c8f7fc
1 file changed
util/logging.sh
@@ -130,8 +130,11 @@ function fatal {
130
[ ! -z "${STATUS##*[!0-9]*}" ] || STATUS=3
131
132
# kill all child processes in current subshell
133
- jobs -p | xargs 'kill -9 --' 2>/dev/null
+ local -a CHILD_PIDS=()
134
+ mapfile -t CHILD_PIDS < <(jobs -p 2>/dev/null || true)
135
+ if (( "${#CHILD_PIDS[@]}" )); then
136
+ kill -9 -- "${CHILD_PIDS[@]}" 2>/dev/null || true
137
+ fi
138
139
exit $STATUS
140
}
-
0 commit comments