@@ -311,11 +311,11 @@ readonly -f nullexec
|
|||||||
anywait() {
|
anywait() {
|
||||||
declare counter timeout
|
declare counter timeout
|
||||||
var counter = 0
|
var counter = 0
|
||||||
var timeout = "$2"
|
var timeout = $(( $2 * 10 )) # We sleep for 0.1, but the timeout is given in seconds.
|
||||||
|
|
||||||
while nullexec kill -0 "$1"; do
|
while nullexec kill -0 "$1"; do
|
||||||
timeout && {
|
timeout && {
|
||||||
(( counter >= (timeout*10) )) && return 1
|
(( counter >= timeout )) && return 1
|
||||||
counter++
|
counter++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user