Making use of set_rcvar.

Jilles Tjoelker jilles at stack.nl
Fri Jan 6 15:17:42 UTC 2012


On Fri, Jan 06, 2012 at 03:13:03PM +0100, Pawel Jakub Dawidek wrote:
> Any objections?

> 	http://people.freebsd.org/~pjd/patches/set_rcvar.patch

> This patch only changes scripts where set_rcvar can be used with no
> arguments.

While this makes the scripts cleaner, it will lead to extra forks with
the current implementation of sh which will slow down boot to some
extent. The effect is small on x86 but may be large on embedded
platforms.

If I could change history, I would have forbidden calling a function
from a command substitution like that in the template. Instead, the
function should be called normally and should set the variable itself.
However, I think that cannot be changed anymore.

I have a fairly small patch to sh to eliminate the fork when expanding
$(set_rcvar). However, one could object that this does not add true new
capabilities but only a new notation to the part of the language that
executes without forks (because the function could write into a variable
instead of being command-substituted).

-- 
Jilles Tjoelker


More information about the freebsd-rc mailing list