diff options
author | Bryan Drewery <bryan@shatow.net> | 2020-06-12 21:14:04 +0300 |
---|---|---|
committer | Bryan Drewery <bryan@shatow.net> | 2021-09-03 01:41:07 +0300 |
commit | 6908b9791f182128d63c499a36682c0d506e14cc (patch) | |
tree | 3304d6d0a75d96b892cde52f4538d935fd117f33 /src | |
parent | f61da72ad62723868af26581984b0b21586e5a07 (diff) |
The trappedinfo hack can use read_blocking() now.
Diffstat (limited to 'src')
-rw-r--r-- | src/share/poudriere/common.sh | 4 | ||||
-rw-r--r-- | src/share/poudriere/include/parallel.sh | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index fdfb726d..a391b2d4 100644 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -1439,7 +1439,6 @@ ${COLOR_RESET}Tobuild: %-${queue_width}d Time: %s\n" \ siginfo_handler() { local IFS; unset IFS; - trappedinfo=1 in_siginfo_handler=1 if [ "${POUDRIERE_BUILD_TYPE}" != "bulk" ]; then return 0 @@ -4602,8 +4601,7 @@ build_queue() { update_remaining # Wait for an event from a child. All builders are busy. - unset jobid; until trappedinfo=; read -t ${timeout} jobid <&6 || - [ -z "$trappedinfo" ]; do :; done + read_blocking -t "${timeout}" jobid <&6 || : if [ -n "${jobid}" ]; then # A job just finished. if job_done "${jobid}"; then diff --git a/src/share/poudriere/include/parallel.sh b/src/share/poudriere/include/parallel.sh index 451819e0..62d20358 100644 --- a/src/share/poudriere/include/parallel.sh +++ b/src/share/poudriere/include/parallel.sh @@ -243,7 +243,7 @@ parallel_run() { # Only read once all slots are taken up; burst jobs until maxed out. # NBPARALLEL is never decreased and only inreased until maxed. if [ ${NBPARALLEL} -eq ${PARALLEL_JOBS} ]; then - unset a; until trappedinfo=; read a <&9 || [ -z "$trappedinfo" ]; do :; done + read_blocking a <&9 || : fi [ ${NBPARALLEL} -lt ${PARALLEL_JOBS} ] && NBPARALLEL=$((NBPARALLEL + 1)) @@ -306,8 +306,7 @@ nohang() { # This is done instead of a 'sleep' as it should recognize # the command has completed right away instead of waiting # on the 'sleep' to finish - unset n; until trappedinfo=; read -t $read_timeout n <&8 || - [ -z "$trappedinfo" ]; do :; done + read_blocking -t "${read_timeout}" n <&8 || : if [ "${n}" = "done" ]; then _wait $childpid || ret=1 break |