From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 583C3138202 for ; Tue, 18 Dec 2012 05:24:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2BF5321C0B4; Tue, 18 Dec 2012 05:24:22 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AB93821C0B4 for ; Tue, 18 Dec 2012 05:24:21 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C5FB933DB06 for ; Tue, 18 Dec 2012 05:24:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 6B3DDE5442 for ; Tue, 18 Dec 2012 05:24:19 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1355808242.7557d62870a3ee92ff43e97bab734e2deaf3cb8a.vapier@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/net.lo.in X-VCS-Directories: init.d/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 7557d62870a3ee92ff43e97bab734e2deaf3cb8a X-VCS-Branch: master Date: Tue, 18 Dec 2012 05:24:19 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 6c368f3a-98e2-446a-a69f-e9e9d56590cb X-Archives-Hash: 13fcfa05ce2050e90232f2b71ead5198 commit: 7557d62870a3ee92ff43e97bab734e2deaf3cb8a Author: Mike Frysinger gentoo org> AuthorDate: Tue Dec 18 05:20:23 2012 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Tue Dec 18 05:24:02 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=7557d628 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 gentoo.org> --- init.d/net.lo.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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