From 7557d62870a3ee92ff43e97bab734e2deaf3cb8a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 18 Dec 2012 00:20:23 -0500 Subject: net.lo: sleep *after* carrier check For devices that are always connected (e.g. ethernet cards), the current carrier always wastes time by sleeping for 1 second. This is because the code sleeps first, then checks for carrier. Invert the order so that we return quickly for devices already active. For devices which are not yet up, there shouldn't be any real difference. Signed-off-by: Mike Frysinger --- init.d/net.lo.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.d/net.lo.in b/init.d/net.lo.in index d42b5ae..51833f2 100644 --- a/init.d/net.lo.in +++ b/init.d/net.lo.in @@ -116,12 +116,12 @@ _wait_for_carrier() yesno ${RC_PARALLEL} && efunc=einfo ${efunc} "Waiting for carrier (${timeout} seconds) " while [ ${timeout} -gt 0 ]; do - sleep 1 if _has_carrier; then [ "${efunc}" = "einfon" ] && echo eend 0 return 0 fi + sleep 1 : $(( timeout -= 1 )) [ "${efunc}" = "einfon" ] && printf "." done -- cgit v1.2.3