Index: src/share/poudriere/common.sh ================================================================== --- src/share/poudriere/common.sh +++ src/share/poudriere/common.sh @@ -217,11 +217,11 @@ log_stop() { if [ -n "${tpid}" ]; then exec 1>&3 3>&- 2>&4 4>&- kill $tpid - wait $tpid 2>/dev/null || : + pwait $tpid; wait $tpid 2>/dev/null || : unset tpid fi } attr_set() { @@ -988,11 +988,11 @@ # Ensure there is a pidfile to read or break [ "${pid}" = "${MASTERMNT}/poudriere/var/run/*.pid" ] && break pkill -15 -F ${pid} >/dev/null 2>&1 || : done fi - wait + until wait; do :; done jail_stop rm -rf ${POUDRIERE_DATA}/packages/${MASTERNAME}/.new_packages \ || : @@ -1100,11 +1100,11 @@ childpid=$! # Now wait on the cmd with a timeout on the log's mtime while :; do if ! kill -CHLD $childpid 2>/dev/null; then - wait $childpid || ret=1 + pwait $childpid; wait $childpid || ret=1 break fi lastupdated=$(stat -f "%m" ${logfile}) now=$(date +%s) @@ -1124,11 +1124,11 @@ # the command has completed right away instead of waiting # on the 'sleep' to finish unset n; until trappedinfo=; read -t $read_timeout n <&7 || [ -z "$trappedinfo" ]; do :; done if [ "${n}" = "done" ]; then - wait $childpid || ret=1 + pwait $childpid; wait $childpid || ret=1 break fi # Not done, was a timeout, check the log time done @@ -1643,11 +1643,11 @@ stop_html_json() { local log=$(log_path) if [ -n "${JSON_PID}" ]; then kill ${JSON_PID} 2>/dev/null || : - wait ${JSON_PID} 2>/dev/null || : + pwait ${JSON_PID} ; wait ${JSON_PID} 2>/dev/null || : unset JSON_PID fi build_json 2>/dev/null || : rm -f ${log}/.data.json.tmp 2>/dev/null || : } @@ -2389,11 +2389,11 @@ parallel_stop() { for pid in ${PARALLEL_PIDS}; do # This will read the return code of each child # and properly error out if the children errored - wait ${pid} + pwait ${pid}; wait ${pid} done exec 6<&- exec 6>&- unset PARALLEL_PIDS