summaryrefslogtreecommitdiffstats
path: root/tests/util.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2025-05-30 12:19:11 -0400
committerTavian Barnes <tavianator@tavianator.com>2025-05-30 13:06:10 -0400
commita0fe051f8b2bcc919d67f822b674cdfe8cf1274b (patch)
tree3dec473f016eeddf4470056b50207c2e75facc17 /tests/util.sh
parent79e86eb3baddb9502abf907a80383d810487602f (diff)
downloadbfs-a0fe051f8b2bcc919d67f822b674cdfe8cf1274b.tar.xz
tests/util: Wrap wait EINTR loop into a helperHEADmain
Diffstat (limited to 'tests/util.sh')
-rw-r--r--tests/util.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/util.sh b/tests/util.sh
index 4bdb86f..e3eca60 100644
--- a/tests/util.sh
+++ b/tests/util.sh
@@ -202,3 +202,16 @@ nproc() {
|| echo 1
} 2>/dev/null
}
+
+# Run wait, looping if interrupted
+_wait() {
+ local ret=130
+
+ # "If wait is interrupted by a signal, the return status will be greater than 128"
+ while ((ret > 128)); do
+ ret=0
+ wait "$@" || ret=$?
+ done
+
+ return $ret
+}