Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc If _rc_subr_loaded=true, "return" immediately, otherwise...



details:   https://anonhg.NetBSD.org/src/rev/7c9cb47d2998
branches:  trunk
changeset: 548454:7c9cb47d2998
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Jun 27 05:01:21 2003 +0000

description:
If _rc_subr_loaded=true, "return" immediately, otherwise set that var
and continue as normal.
Gains ~ 2 seconds on 110 runs of ". rc.subr" on a shark.
Suggested by Andrew Cagney in [bin/18400]

diffstat:

 etc/rc.subr |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (22 lines):

diff -r 01592c906059 -r 7c9cb47d2998 etc/rc.subr
--- a/etc/rc.subr       Fri Jun 27 04:06:01 2003 +0000
+++ b/etc/rc.subr       Fri Jun 27 05:01:21 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.57 2003/06/27 04:06:01 lukem Exp $
+# $NetBSD: rc.subr,v 1.58 2003/06/27 05:01:21 lukem Exp $
 #
 # Copyright (c) 1997-2002 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -38,6 +38,12 @@
 #      functions used by various rc scripts
 #
 
+if ${_rc_subr_loaded:-false}; then
+       return
+else
+       _rc_subr_loaded=true
+fi
+
 #
 #      functions
 #      ---------



Home | Main Index | Thread Index | Old Index