From: kili Date: Mon, 11 Aug 2014 20:16:04 +0000 (+0000) Subject: Let _rc_parse_conf stick to parsing /etc/rc.conf and /etc/rc.conf.local X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a47c2043c23df77b2b04271626421dd3addbb65a;p=openbsd 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@ --- diff --git a/etc/rc.d/rc.subr b/etc/rc.d/rc.subr index febe747278e..227a227f7e6 100644 --- a/etc/rc.d/rc.subr +++ b/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}