Author: jilles
Date: Sun Jul  3 16:32:03 2011
New Revision: 223742
URL: http://svn.freebsd.org/changeset/base/223742

Log:
  MFC r223227: 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.
  
  The change in the _echoonce function is not included in this MFC because
  stable/8 does not have this function.

Modified:
  stable/8/etc/rc.subr
Directory Properties:
  stable/8/etc/   (props changed)

Modified: stable/8/etc/rc.subr
==============================================================================
--- stable/8/etc/rc.subr        Sun Jul  3 16:08:38 2011        (r223741)
+++ stable/8/etc/rc.subr        Sun Jul  3 16:32:03 2011        (r223742)
@@ -1066,7 +1066,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
@@ -1074,9 +1074,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
                "")
                        ;;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to