aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/network-functions
diff options
context:
space:
mode:
authorDavid Kaspar [Dee'Kej] <dkaspar@redhat.com>2017-05-25 13:25:55 +0200
committerDee'Kej <deekej@linuxmail.org>2017-05-25 14:10:20 +0200
commit1d039be1e7ed54bca38a2ba290bb4b6a027dd3d5 (patch)
treeda8503a85b357faba6836e10c3f91394628abb02 /sysconfig/network-scripts/network-functions
parent4b0db77c17ce8c29709587bdcc88927a9d5ee651 (diff)
downloadinitscripts-1d039be1e7ed54bca38a2ba290bb4b6a027dd3d5.tar
initscripts-1d039be1e7ed54bca38a2ba290bb4b6a027dd3d5.tar.gz
initscripts-1d039be1e7ed54bca38a2ba290bb4b6a027dd3d5.tar.bz2
initscripts-1d039be1e7ed54bca38a2ba290bb4b6a027dd3d5.tar.xz
initscripts-1d039be1e7ed54bca38a2ba290bb4b6a027dd3d5.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.
Diffstat (limited to 'sysconfig/network-scripts/network-functions')
-rw-r--r--sysconfig/network-scripts/network-functions8
1 files changed, 6 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 1867c38a..330f6738 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
@@ -464,7 +468,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