summaryrefslogtreecommitdiffstats
path: root/etc/rc.subr
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-06-18 11:05:30 +0000
committerjilles <jilles@FreeBSD.org>2011-06-18 11:05:30 +0000
commit784b15655084691642334c13097cf2ecf023679d (patch)
treef934c4c0b3fda5273c96e18d9fdab0657ad381ae /etc/rc.subr
parentc5bf0bda0e1840bed21f5154361074a744e3a430 (diff)
downloadFreeBSD-src-784b15655084691642334c13097cf2ecf023679d.zip
FreeBSD-src-784b15655084691642334c13097cf2ecf023679d.tar.gz
rc.subr: Eliminate about 100 forks from the boot sequence.
With the current sh, placing eval in a command substitution always results in a fork(), even if it is the only command and only executes a single simple command. Therefore, avoid it where it can be avoided easily. Side effect: values starting with a hyphen and all whitespace are preserved. The values are defaults and names for rc.conf variables and messages to be given about obsolete ones. MFC after: 2 weeks
Diffstat (limited to 'etc/rc.subr')
-rw-r--r--etc/rc.subr10
1 files changed, 5 insertions, 5 deletions
diff --git a/etc/rc.subr b/etc/rc.subr
index 97d449c..7bd1021 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -1062,7 +1062,7 @@ load_rc_config()
# Set defaults if defined.
for _var in $rcvar $rcvars; do
- _defval=`eval echo "\\\$${_var}_defval"`
+ eval _defval=\$${_var}_defval
if [ -n "$_defval" ]; then
eval : \${$_var:=\$${_var}_defval}
fi
@@ -1070,9 +1070,9 @@ load_rc_config()
# check obsolete rc.conf variables
for _var in $rcvars_obsolete; do
- _v=`eval echo \\$$_var`
- _msg=`eval echo \\$${_var}_obsolete_msg`
- _new=`eval echo \\$${_var}_newvar`
+ eval _v=\$$_var
+ eval _msg=\$${_var}_obsolete_msg
+ eval _new=\$${_var}_newvar
case $_v in
"")
;;
@@ -1765,7 +1765,7 @@ check_kern_features()
_echoonce()
{
local _var _msg _mode
- _var=`eval echo \\$$1`
+ eval _var=\$$1
_msg=$2
_mode=$3
OpenPOWER on IntegriCloud