From owner-svn-src-all@FreeBSD.ORG Sat Jun 18 11:05:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7951C106566B; Sat, 18 Jun 2011 11:05:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 690618FC14; Sat, 18 Jun 2011 11:05:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p5IB5UjX037236; Sat, 18 Jun 2011 11:05:30 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p5IB5UbI037234; Sat, 18 Jun 2011 11:05:30 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201106181105.p5IB5UbI037234@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 18 Jun 2011 11:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223227 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jun 2011 11:05:30 -0000 Author: jilles Date: Sat Jun 18 11:05:30 2011 New Revision: 223227 URL: http://svn.freebsd.org/changeset/base/223227 Log: 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 Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sat Jun 18 10:48:00 2011 (r223226) +++ head/etc/rc.subr Sat Jun 18 11:05:30 2011 (r223227) @@ -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