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 DBDCF139B2A for ; Fri, 18 Sep 2015 17:46:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B269921C010; Fri, 18 Sep 2015 17:46:02 +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 404B521C010 for ; Fri, 18 Sep 2015 17:46:02 +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 179B03409D7 for ; Fri, 18 Sep 2015 17:46:01 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 76071186 for ; Fri, 18 Sep 2015 17:45:58 +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: <1442520150.3b6a6df4b5b818e576a88444632d5c73cffd1c57.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/openrc-run.c X-VCS-Directories: src/rc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 3b6a6df4b5b818e576a88444632d5c73cffd1c57 X-VCS-Branch: master Date: Fri, 18 Sep 2015 17:45:58 +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: a4ff0e24-c583-486b-ad2f-b4ca7f48d7ad X-Archives-Hash: 5fea8391a6217b359d4678c431b53335 commit: 3b6a6df4b5b818e576a88444632d5c73cffd1c57 Author: William Hubbs gmail com> AuthorDate: Thu Sep 17 20:02:30 2015 +0000 Commit: William Hubbs gentoo org> CommitDate: Thu Sep 17 20:02:30 2015 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=3b6a6df4 openrc-run: rename some dependency variables and a function for clarity All of the dependency type lists had the types_ prefix in their names; this has been changed to deptypes_ to make them more self documenting. Along the same lines, the setup_types function was renamed setup_deptypes. src/rc/openrc-run.c | 76 ++++++++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/src/rc/openrc-run.c b/src/rc/openrc-run.c index 989779b..f3a009e 100644 --- a/src/rc/openrc-run.c +++ b/src/rc/openrc-run.c @@ -85,8 +85,12 @@ static bool sighup, in_background, deps, dry_run; static pid_t service_pid; static int signal_pipe[2] = { -1, -1 }; -static RC_STRINGLIST *types_b, *types_n, *types_nu, *types_nua, *types_m; -static RC_STRINGLIST *types_mua = NULL; +static RC_STRINGLIST *deptypes_b; +static RC_STRINGLIST *deptypes_n; +static RC_STRINGLIST *deptypes_nu; +static RC_STRINGLIST *deptypes_nua; +static RC_STRINGLIST *deptypes_m; +static RC_STRINGLIST *deptypes_mua; static void handle_signal(int sig) @@ -231,12 +235,12 @@ cleanup(void) rc_plugin_unload(); #ifdef DEBUG_MEMORY - rc_stringlist_free(types_b); - rc_stringlist_free(types_n); - rc_stringlist_free(types_nu); - rc_stringlist_free(types_nua); - rc_stringlist_free(types_m); - rc_stringlist_free(types_mua); + rc_stringlist_free(deptypes_b); + rc_stringlist_free(deptypes_n); + rc_stringlist_free(deptypes_nu); + rc_stringlist_free(deptypes_nua); + rc_stringlist_free(deptypes_m); + rc_stringlist_free(deptypes_mua); rc_deptree_free(deptree); rc_stringlist_free(restart_services); rc_stringlist_free(need_services); @@ -518,30 +522,30 @@ get_started_services(void) } static void -setup_types(void) +setup_deptypes(void) { - types_b = rc_stringlist_new(); - rc_stringlist_add(types_b, "broken"); + deptypes_b = rc_stringlist_new(); + rc_stringlist_add(deptypes_b, "broken"); - types_n = rc_stringlist_new(); - rc_stringlist_add(types_n, "ineed"); + deptypes_n = rc_stringlist_new(); + rc_stringlist_add(deptypes_n, "ineed"); - types_nu = rc_stringlist_new(); - rc_stringlist_add(types_nu, "ineed"); - rc_stringlist_add(types_nu, "iuse"); + deptypes_nu = rc_stringlist_new(); + rc_stringlist_add(deptypes_nu, "ineed"); + rc_stringlist_add(deptypes_nu, "iuse"); - types_nua = rc_stringlist_new(); - rc_stringlist_add(types_nua, "ineed"); - rc_stringlist_add(types_nua, "iuse"); - rc_stringlist_add(types_nua, "iafter"); + deptypes_nua = rc_stringlist_new(); + rc_stringlist_add(deptypes_nua, "ineed"); + rc_stringlist_add(deptypes_nua, "iuse"); + rc_stringlist_add(deptypes_nua, "iafter"); - types_m = rc_stringlist_new(); - rc_stringlist_add(types_m, "needsme"); + deptypes_m = rc_stringlist_new(); + rc_stringlist_add(deptypes_m, "needsme"); - types_mua = rc_stringlist_new(); - rc_stringlist_add(types_mua, "needsme"); - rc_stringlist_add(types_mua, "usesme"); - rc_stringlist_add(types_mua, "beforeme"); + deptypes_mua = rc_stringlist_new(); + rc_stringlist_add(deptypes_mua, "needsme"); + rc_stringlist_add(deptypes_mua, "usesme"); + rc_stringlist_add(deptypes_mua, "beforeme"); } static void @@ -604,10 +608,10 @@ svc_start_deps(void) if (!deptree && ((deptree = _rc_deptree_load(0, NULL)) == NULL)) eerrorx("failed to load deptree"); - if (!types_b) - setup_types(); + if (!deptypes_b) + setup_deptypes(); - services = rc_deptree_depends(deptree, types_b, applet_list, + services = rc_deptree_depends(deptree, deptypes_b, applet_list, runlevel, 0); if (TAILQ_FIRST(services)) { eerrorn("ERROR: %s needs service(s) ", applet); @@ -625,9 +629,9 @@ svc_start_deps(void) rc_stringlist_free(services); services = NULL; - need_services = rc_deptree_depends(deptree, types_n, + need_services = rc_deptree_depends(deptree, deptypes_n, applet_list, runlevel, depoptions); - use_services = rc_deptree_depends(deptree, types_nu, + use_services = rc_deptree_depends(deptree, deptypes_nu, applet_list, runlevel, depoptions); if (!rc_runlevel_starting()) { @@ -655,7 +659,7 @@ svc_start_deps(void) return; /* Now wait for them to start */ - services = rc_deptree_depends(deptree, types_nua, applet_list, + services = rc_deptree_depends(deptree, deptypes_nua, applet_list, runlevel, depoptions); /* We use tmplist to hold our scheduled by list */ tmplist = rc_stringlist_new(); @@ -860,10 +864,10 @@ svc_stop_deps(RC_SERVICE state) if (!deptree && ((deptree = _rc_deptree_load(0, NULL)) == NULL)) eerrorx("failed to load deptree"); - if (!types_m) - setup_types(); + if (!deptypes_m) + setup_deptypes(); - services = rc_deptree_depends(deptree, types_m, applet_list, + services = rc_deptree_depends(deptree, deptypes_m, applet_list, runlevel, depoptions); tmplist = rc_stringlist_new(); TAILQ_FOREACH_REVERSE(svc, services, rc_stringlist, entries) { @@ -923,7 +927,7 @@ svc_stop_deps(RC_SERVICE state) /* We now wait for other services that may use us and are * stopping. This is important when a runlevel stops */ - services = rc_deptree_depends(deptree, types_mua, applet_list, + services = rc_deptree_depends(deptree, deptypes_mua, applet_list, runlevel, depoptions); TAILQ_FOREACH(svc, services, entries) { if (rc_service_state(svc->value) & RC_SERVICE_STOPPED)