rc: Rename some static variables to kill warnings

This commit is contained in:
Doug Freed 2016-07-16 20:10:37 +00:00
parent 3a1262703f
commit c962678dd6

View File

@ -86,12 +86,12 @@ const char *usagestring = "" \
#define DEVBOOT "/dev/.rcboot" #define DEVBOOT "/dev/.rcboot"
const char *applet = NULL; const char *applet = NULL;
static RC_STRINGLIST *hotplugged_services; static RC_STRINGLIST *main_hotplugged_services;
static RC_STRINGLIST *stop_services; static RC_STRINGLIST *main_stop_services;
static RC_STRINGLIST *start_services; static RC_STRINGLIST *main_start_services;
static RC_STRINGLIST *types_nw; static RC_STRINGLIST *main_types_nw;
static RC_STRINGLIST *types_nwua; static RC_STRINGLIST *main_types_nwua;
static RC_DEPTREE *deptree; static RC_DEPTREE *main_deptree;
static char *runlevel; static char *runlevel;
static RC_HOOK hook_out; static RC_HOOK hook_out;
@ -162,12 +162,12 @@ cleanup(void)
p1 = p2; p1 = p2;
} }
rc_stringlist_free(hotplugged_services); rc_stringlist_free(main_hotplugged_services);
rc_stringlist_free(stop_services); rc_stringlist_free(main_stop_services);
rc_stringlist_free(start_services); rc_stringlist_free(main_start_services);
rc_stringlist_free(types_nw); rc_stringlist_free(main_types_nw);
rc_stringlist_free(types_nwua); rc_stringlist_free(main_types_nwua);
rc_deptree_free(deptree); rc_deptree_free(main_deptree);
free(runlevel); free(runlevel);
} }
@ -939,7 +939,7 @@ int main(int argc, char **argv)
} }
/* Load our deptree */ /* Load our deptree */
if ((deptree = _rc_deptree_load(0, &regen)) == NULL) if ((main_deptree = _rc_deptree_load(0, &regen)) == NULL)
eerrorx("failed to load deptree"); eerrorx("failed to load deptree");
if (exists(RC_DEPTREE_SKEWED)) if (exists(RC_DEPTREE_SKEWED))
ewarn("WARNING: clock skew detected!"); ewarn("WARNING: clock skew detected!");
@ -961,27 +961,27 @@ int main(int argc, char **argv)
* in the new or current runlevel so we won't actually be stopping * in the new or current runlevel so we won't actually be stopping
* them all. * them all.
*/ */
stop_services = rc_services_in_state(RC_SERVICE_STARTED); main_stop_services = rc_services_in_state(RC_SERVICE_STARTED);
tmplist = rc_services_in_state(RC_SERVICE_INACTIVE); tmplist = rc_services_in_state(RC_SERVICE_INACTIVE);
TAILQ_CONCAT(stop_services, tmplist, entries); TAILQ_CONCAT(main_stop_services, tmplist, entries);
free(tmplist); free(tmplist);
tmplist = rc_services_in_state(RC_SERVICE_STARTING); tmplist = rc_services_in_state(RC_SERVICE_STARTING);
TAILQ_CONCAT(stop_services, tmplist, entries); TAILQ_CONCAT(main_stop_services, tmplist, entries);
free(tmplist); free(tmplist);
if (stop_services) if (main_stop_services)
rc_stringlist_sort(&stop_services); rc_stringlist_sort(&main_stop_services);
types_nwua = rc_stringlist_new(); main_types_nwua = rc_stringlist_new();
rc_stringlist_add(types_nwua, "ineed"); rc_stringlist_add(main_types_nwua, "ineed");
rc_stringlist_add(types_nwua, "iwant"); rc_stringlist_add(main_types_nwua, "iwant");
rc_stringlist_add(types_nwua, "iuse"); rc_stringlist_add(main_types_nwua, "iuse");
rc_stringlist_add(types_nwua, "iafter"); rc_stringlist_add(main_types_nwua, "iafter");
if (stop_services) { if (main_stop_services) {
tmplist = rc_deptree_depends(deptree, types_nwua, stop_services, tmplist = rc_deptree_depends(main_deptree, main_types_nwua, main_stop_services,
runlevel, depoptions | RC_DEP_STOP); runlevel, depoptions | RC_DEP_STOP);
rc_stringlist_free(stop_services); rc_stringlist_free(main_stop_services);
stop_services = tmplist; main_stop_services = tmplist;
} }
/* Create a list of all services which should be started for the new or /* Create a list of all services which should be started for the new or
@ -989,14 +989,14 @@ int main(int argc, char **argv)
* runlevels. Clearly, some of these will already be started so we * runlevels. Clearly, some of these will already be started so we
* won't actually be starting them all. * won't actually be starting them all.
*/ */
hotplugged_services = rc_services_in_state(RC_SERVICE_HOTPLUGGED); main_hotplugged_services = rc_services_in_state(RC_SERVICE_HOTPLUGGED);
start_services = rc_services_in_runlevel_stacked(newlevel ? main_start_services = rc_services_in_runlevel_stacked(newlevel ?
newlevel : runlevel); newlevel : runlevel);
if (strcmp(newlevel ? newlevel : runlevel, RC_LEVEL_SHUTDOWN) != 0 && if (strcmp(newlevel ? newlevel : runlevel, RC_LEVEL_SHUTDOWN) != 0 &&
strcmp(newlevel ? newlevel : runlevel, RC_LEVEL_SYSINIT) != 0) strcmp(newlevel ? newlevel : runlevel, RC_LEVEL_SYSINIT) != 0)
{ {
tmplist = rc_services_in_runlevel(RC_LEVEL_SYSINIT); tmplist = rc_services_in_runlevel(RC_LEVEL_SYSINIT);
TAILQ_CONCAT(start_services, tmplist, entries); TAILQ_CONCAT(main_start_services, tmplist, entries);
free(tmplist); free(tmplist);
/* If we are NOT headed for the single-user runlevel... */ /* If we are NOT headed for the single-user runlevel... */
if (strcmp(newlevel ? newlevel : runlevel, if (strcmp(newlevel ? newlevel : runlevel,
@ -1007,13 +1007,13 @@ int main(int argc, char **argv)
bootlevel) != 0) bootlevel) != 0)
{ {
tmplist = rc_services_in_runlevel(bootlevel); tmplist = rc_services_in_runlevel(bootlevel);
TAILQ_CONCAT(start_services, tmplist, entries); TAILQ_CONCAT(main_start_services, tmplist, entries);
free(tmplist); free(tmplist);
} }
if (hotplugged_services) { if (main_hotplugged_services) {
TAILQ_FOREACH(service, hotplugged_services, TAILQ_FOREACH(service, main_hotplugged_services,
entries) entries)
rc_stringlist_addu(start_services, rc_stringlist_addu(main_start_services,
service->value); service->value);
} }
} }
@ -1022,8 +1022,8 @@ int main(int argc, char **argv)
parallel = rc_conf_yesno("rc_parallel"); parallel = rc_conf_yesno("rc_parallel");
/* Now stop the services that shouldn't be running */ /* Now stop the services that shouldn't be running */
if (stop_services && !nostop) if (main_stop_services && !nostop)
do_stop_services(types_nw, start_services, stop_services, deptree, newlevel, parallel, going_down); do_stop_services(main_types_nw, main_start_services, main_stop_services, main_deptree, newlevel, parallel, going_down);
/* Wait for our services to finish */ /* Wait for our services to finish */
wait_for_services(); wait_for_services();
@ -1055,8 +1055,8 @@ int main(int argc, char **argv)
hook_out = RC_HOOK_RUNLEVEL_START_OUT; hook_out = RC_HOOK_RUNLEVEL_START_OUT;
/* Re-add our hotplugged services if they stopped */ /* Re-add our hotplugged services if they stopped */
if (hotplugged_services) if (main_hotplugged_services)
TAILQ_FOREACH(service, hotplugged_services, entries) TAILQ_FOREACH(service, main_hotplugged_services, entries)
rc_service_mark(service->value, RC_SERVICE_HOTPLUGGED); rc_service_mark(service->value, RC_SERVICE_HOTPLUGGED);
#ifdef __linux__ #ifdef __linux__
@ -1072,7 +1072,7 @@ int main(int argc, char **argv)
#endif #endif
/* If we have a list of services to start then... */ /* If we have a list of services to start then... */
if (start_services) { if (main_start_services) {
/* Get a list of the chained runlevels which compose the target runlevel */ /* Get a list of the chained runlevels which compose the target runlevel */
RC_STRINGLIST *runlevel_chain = rc_runlevel_stacks(runlevel); RC_STRINGLIST *runlevel_chain = rc_runlevel_stacks(runlevel);
@ -1085,7 +1085,7 @@ int main(int argc, char **argv)
/* Start those services. */ /* Start those services. */
rc_stringlist_sort(&run_services); rc_stringlist_sort(&run_services);
deporder = rc_deptree_depends(deptree, types_nwua, run_services, rlevel->value, depoptions | RC_DEP_START); deporder = rc_deptree_depends(main_deptree, main_types_nwua, run_services, rlevel->value, depoptions | RC_DEP_START);
rc_stringlist_free(run_services); rc_stringlist_free(run_services);
run_services = deporder; run_services = deporder;
do_start_services(run_services, parallel); do_start_services(run_services, parallel);