diff options
author | David Kaspar [Dee'Kej] <dkaspar@redhat.com> | 2017-05-25 13:25:55 +0200 |
---|---|---|
committer | Dee'Kej <deekej@linuxmail.org> | 2017-10-31 12:36:19 +0100 |
commit | 3e524c51a3438cbfc92a5ad19614b3bf8fbd4000 (patch) | |
tree | 1eb2ddff78f99fac8c843de947a13cae1cb9dc70 | |
parent | 40eb870afeb4c984e1b9035100e65acb03812ac0 (diff) | |
download | initscripts-3e524c51a3438cbfc92a5ad19614b3bf8fbd4000.tar initscripts-3e524c51a3438cbfc92a5ad19614b3bf8fbd4000.tar.gz initscripts-3e524c51a3438cbfc92a5ad19614b3bf8fbd4000.tar.bz2 initscripts-3e524c51a3438cbfc92a5ad19614b3bf8fbd4000.tar.xz initscripts-3e524c51a3438cbfc92a5ad19614b3bf8fbd4000.zip |
Replace usleep(1) calls with sleep(1) calls
The time units had to be manually converted from microseconds to
seconds. Hopefully this was done right.
-rw-r--r-- | rc.d/init.d/functions | 4 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifdown-eth | 2 | ||||
-rw-r--r-- | sysconfig/network-scripts/network-functions | 8 |
3 files changed, 9 insertions, 5 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index b2a29190..08d7e0f4 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -154,7 +154,7 @@ __kill_pids_term_kill() { [ -z "$kill_list" ] && return 0 kill -TERM $kill_list >/dev/null 2>&1 - usleep 100000 + sleep 0.1 kill_list=$(__kill_pids_term_kill_checkpids $base_stime $kill_list) if [ -n "$kill_list" ] ; then @@ -166,7 +166,7 @@ __kill_pids_term_kill() { done if [ -n "$kill_list" ] ; then kill -KILL $kill_list >/dev/null 2>&1 - usleep 100000 + sleep 0.1 kill_list=$(__kill_pids_term_kill_checkpids $base_stime $kill_list) fi fi diff --git a/sysconfig/network-scripts/ifdown-eth b/sysconfig/network-scripts/ifdown-eth index 7ccbddf1..040d52d8 100755 --- a/sysconfig/network-scripts/ifdown-eth +++ b/sysconfig/network-scripts/ifdown-eth @@ -159,7 +159,7 @@ fi # wait up to 5 seconds for device to actually come down... waited=0 while ! check_device_down ${DEVICE} && [ "$waited" -lt 50 ] ; do - usleep 10000 + sleep 0.01 waited=$(($waited+1)) done diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions index 7f5dfb0a..d72901ea 100644 --- a/sysconfig/network-scripts/network-functions +++ b/sysconfig/network-scripts/network-functions @@ -196,7 +196,11 @@ ethtool_set() { oldifs=$IFS; IFS=';'; - [ -n "${ETHTOOL_DELAY}" ] && /bin/usleep ${ETHTOOL_DELAY} + if [ -n "${ETHTOOL_DELAY}" ]; then + # Convert microseconds to seconds: + local ETHTOOL_DELAY_SEC=$(awk "BEGIN {printf \"%f\", ${ETHTOOL_DELAY} / 1000000}") + sleep ${ETHTOOL_DELAY_SEC} + fi for opts in $ETHTOOL_OPTS ; do IFS=$oldifs; if [[ "${opts}" =~ [[:space:]]*- ]]; then @@ -470,7 +474,7 @@ check_link_down () [ -n "$LINKDELAY" ] && delay=$(($LINKDELAY * 2)) while [ $timeout -le $delay ]; do [ "$(cat /sys/class/net/$REALDEVICE/carrier 2>/dev/null)" != "0" ] && return 1 - usleep 500000 + sleep 0.5 timeout=$((timeout+1)) done return 0 |