just handle rc of wait instead of comparing bash version
This commit is contained in:
@@ -610,12 +610,10 @@ while :; do
|
|||||||
ps -p $pid >/dev/null && kill -SIGKILL $pid
|
ps -p $pid >/dev/null && kill -SIGKILL $pid
|
||||||
rc=137
|
rc=137
|
||||||
else
|
else
|
||||||
if (( ${BASH_VERSINFO[0]} >= 5 )) && (( ${BASH_VERSINFO[1]} >= 1 )); then
|
wait $pid &>/dev/null
|
||||||
wait $pid
|
rc=$?
|
||||||
rc=$?
|
# the wait function in older Bash versions always returns 127 if the sub-proc already exited
|
||||||
else
|
(( rc == 127 )) && rc=0
|
||||||
rc=0
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
echo "gather: $func (PID $pid, FD $fd) exited with rc = $rc" >&$DEBUGLOG
|
echo "gather: $func (PID $pid, FD $fd) exited with rc = $rc" >&$DEBUGLOG
|
||||||
if (( rc == 0 )) && [ -n "$data" ]; then
|
if (( rc == 0 )) && [ -n "$data" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user