From 7d486d6dd1237c8f5468083567725723cb72406e Mon Sep 17 00:00:00 2001 From: kili <> Date: Mon, 11 Aug 2014 20:16:04 +0000 Subject: [PATCH] Let _rc_parse_conf stick to parsing /etc/rc.conf and /etc/rc.conf.local if it's invoked without parameters. It's simpler than adding adding /etc/rc.conf and /etc/rc.conf.local parameters whereever _rc_parse_conf is used (e.g. /etc/rc and /etc/netstart). While here, replace a for foo in "$@"; do something; done by for foo; do something; done ok aja@ --- src/etc/rc.d/rc.subr | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/etc/rc.d/rc.subr b/src/etc/rc.d/rc.subr index febe7472..227a227f 100644 --- a/src/etc/rc.d/rc.subr +++ b/src/etc/rc.d/rc.subr @@ -1,4 +1,4 @@ -# $OpenBSD: rc.subr,v 1.78 2014/08/11 13:25:23 ajacoutot Exp $ +# $OpenBSD: rc.subr,v 1.79 2014/08/11 20:16:04 kili Exp $ # # Copyright (c) 2010, 2011, 2014 Antoine Jacoutot # Copyright (c) 2010, 2011 Ingo Schwarze @@ -121,7 +121,8 @@ _rc_parse_conf() { pf_rules ipsec_rules shlib_dirs pkg_scripts \ nfs_server - for _rcfile in $@; do + [ $# -gt 0 ] || set -- /etc/rc.conf /etc.rc.conf.local + for _rcfile; do [[ -f $_rcfile ]] || continue while IFS=' ' read -r _l; do [[ $_l == [!#=]*=* ]] || continue @@ -263,7 +264,7 @@ _RC_RUNDIR=/var/run/rc.d _RC_RUNFILE=${_RC_RUNDIR}/${_name} # parse /etc/rc.conf{.local} for the daemon_flags -_rc_do _rc_parse_conf /etc/rc.conf /etc/rc.conf.local +_rc_do _rc_parse_conf eval _rcflags=\${${_name}_flags} eval _rcuser=\${${_name}_user}