Skip to content

Commit

Permalink
util (ble/util/msleep): fix detection of decimal command sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Jan 5, 2020
1 parent bf96250 commit e894dee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util.sh
Expand Up @@ -1104,9 +1104,9 @@ function ble/util/msleep/.check-builtin-sleep {
return 1
fi
}
function ble/util/msleep/.check-coreutils-sleep {
local version; ble/util/assign version 'LANG=C ble/bin/sleep --version'
[[ $version == 'GNU coreutils' ]]
function ble/util/msleep/.check-sleep-decimal-support {
local version; ble/util/assign version 'LANG=C ble/bin/sleep --version 2>&1'
[[ $version == *'GNU coreutils'* || $OSTYPE == darwin* && $version == 'usage: sleep seconds' ]]
}

_ble_util_msleep_delay=2000 # [usec]
Expand Down Expand Up @@ -1195,7 +1195,7 @@ elif ble/bin/.freeze-utility-path usleep; then
((v<=0)) && v=0
ble/bin/usleep "$v" &>/dev/null
}
elif ble/util/msleep/.check-coreutils-sleep; then
elif ble/util/msleep/.check-sleep-decimal-support; then
function ble/util/msleep/.core { ble/bin/sleep "$1"; }
fi

Expand Down

0 comments on commit e894dee

Please sign in to comment.