From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 094DB1388C2 for ; Thu, 5 Nov 2015 18:53:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1A620E085A; Thu, 5 Nov 2015 18:53:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7D50BE086A for ; Thu, 5 Nov 2015 18:53:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4D62A340836 for ; Thu, 5 Nov 2015 18:53:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 76EC22122 for ; Thu, 5 Nov 2015 18:53:41 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1446744057.c831f1f994e187afd8edfff15e4063b99440bbcb.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/librc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/librc/librc-misc.c X-VCS-Directories: src/librc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: c831f1f994e187afd8edfff15e4063b99440bbcb X-VCS-Branch: master Date: Thu, 5 Nov 2015 18:53:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 0ede8823-5172-4984-9cd2-03af8acf5c67 X-Archives-Hash: 5fc183bcd8552b0114b3dd602ad527fd commit: c831f1f994e187afd8edfff15e4063b99440bbcb Author: William Hubbs gmail com> AuthorDate: Thu Nov 5 17:08:29 2015 +0000 Commit: William Hubbs gentoo org> CommitDate: Thu Nov 5 17:20:57 2015 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=c831f1f9 librc: rework overriding rc.conf options from the kcl Rename the rc_conf_override function to describe its purpose better, drop one conditional compile by making it available everywhere, and move the call to it after the optional rc.conf.d directory is processed. src/librc/librc-misc.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/librc/librc-misc.c b/src/librc/librc-misc.c index 2c73663..98e6f20 100644 --- a/src/librc/librc-misc.c +++ b/src/librc/librc-misc.c @@ -280,11 +280,14 @@ static void rc_config_set_value(RC_STRINGLIST *config, char *value) } /* - * Override some specific rc.conf options on the kernel command line + * Override some specific rc.conf options on the kernel command line. + * I only know how to do this in Linux, so if someone wants to supply + * a patch for this on *BSD or tell me how to write the code to do this, + * any suggestions are welcome. */ -#ifdef __linux__ -static RC_STRINGLIST *rc_config_override(RC_STRINGLIST *config) +static RC_STRINGLIST *rc_config_kcl(RC_STRINGLIST *config) { +#ifdef __linux__ RC_STRINGLIST *overrides; RC_STRING *cline, *override, *config_np; char *tmp = NULL; @@ -333,9 +336,9 @@ static RC_STRINGLIST *rc_config_override(RC_STRINGLIST *config) } rc_stringlist_free(overrides); +#endif return config; } -#endif static RC_STRINGLIST * rc_config_directory(RC_STRINGLIST *config) { @@ -387,13 +390,6 @@ rc_config_load(const char *file) } rc_stringlist_free(list); -#ifdef __linux__ - /* Only override rc.conf settings */ - if (strcmp(file, RC_CONF) == 0) { - config = rc_config_override(config); - } -#endif - return config; } librc_hidden_def(rc_config_load) @@ -444,6 +440,7 @@ rc_conf_value(const char *setting) } rc_conf = rc_config_directory(rc_conf); + rc_conf = rc_config_kcl(rc_conf); /* Convert old uppercase to lowercase */ TAILQ_FOREACH(s, rc_conf, entries) {