summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2004-07-04 07:21:18 +0000
committercperciva <cperciva@FreeBSD.org>2004-07-04 07:21:18 +0000
commitf02259600de5473e6c6e64dedb982bc901b5394d (patch)
tree22c9365f92e8899fc24d9071111c27da3864171a
parent833ca0492e7de2fe5e0d9c0f37fea54b62593cf5 (diff)
downloadFreeBSD-src-f02259600de5473e6c6e64dedb982bc901b5394d.zip
FreeBSD-src-f02259600de5473e6c6e64dedb982bc901b5394d.tar.gz
Wrap rc.subr inside
if [ -z "${_rc_subr_loaded}" ]; then _rc_subr_loaded="YES" ... fi in order to avoid re-interpreting rc.subr every time an rc.d script is run. In my tests, this speeds up rc time by about 8-10%.
-rw-r--r--etc/rc.subr6
1 files changed, 6 insertions, 0 deletions
diff --git a/etc/rc.subr b/etc/rc.subr
index 349daee..ffbf81a 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -43,6 +43,10 @@
# Operating System dependent/independent variables
#
+if [ -z "${_rc_subr_loaded}" ]; then
+
+_rc_subr_loaded="YES"
+
SYSCTL="/sbin/sysctl"
SYSCTL_N="${SYSCTL} -n"
CMD_OSTYPE="${SYSCTL_N} kern.ostype"
@@ -1286,3 +1290,5 @@ mount_md() {
fi
/sbin/mdmfs $bpi -s $1 -M md $2
}
+
+fi
OpenPOWER on IntegriCloud