Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Nov 2012 18:11:11 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243184 - head/etc
Message-ID:  <201211171811.qAHIBBDF055507@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Sat Nov 17 18:11:10 2012
New Revision: 243184
URL: http://svnweb.freebsd.org/changeset/base/243184

Log:
  Add check_namevarlist() to check if ${name}_var is reserved in rc.subr or not.

Modified:
  head/etc/rc.subr

Modified: head/etc/rc.subr
==============================================================================
--- head/etc/rc.subr	Sat Nov 17 16:47:05 2012	(r243183)
+++ head/etc/rc.subr	Sat Nov 17 18:11:10 2012	(r243184)
@@ -1724,6 +1724,23 @@ check_kern_features()
 	fi
 }
 
+# check_namevarlist var
+#	Return "0" if ${name}_var is reserved in rc.subr.
+
+_rc_namevarlist="program chroot chdir flags fib nice user group groups"
+check_namevarlist()
+{
+	local _v
+
+	for _v in $_rc_namevarlist; do
+	case $1 in
+	$_v)	return 0 ;;
+	esac
+	done
+
+	return 1
+}
+
 # _echoonce var msg mode
 #	mode=0: Echo $msg if ${$var} is empty.
 #	        After doing echo, a string is set to ${$var}.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211171811.qAHIBBDF055507>