@@ -311,11 +311,11 @@ readonly -f nullexec
|
||||
anywait() {
|
||||
declare counter timeout
|
||||
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
|
||||
timeout && {
|
||||
(( counter >= (timeout*10) )) && return 1
|
||||
(( counter >= timeout )) && return 1
|
||||
counter++
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user