aboutsummaryrefslogtreecommitdiff
path: root/src/librc
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-10-10 09:08:59 +0000
committerRoy Marples <roy@marples.name>2008-10-10 09:08:59 +0000
commit50b8aba8d9cd5042f395ed7478400742dd3457f5 (patch)
tree6fb482ad331c504ace5ee64de92a828085a9358b /src/librc
parent72dcac8c55e9994c48739f908d49889d880d8468 (diff)
Remove coldplug and just have hotplug which is a list of allowed/disallowed services. Makes things much easier.
Diffstat (limited to 'src/librc')
-rw-r--r--src/librc/librc-depend.c18
-rw-r--r--src/librc/librc.c6
-rw-r--r--src/librc/rc.h.in4
3 files changed, 14 insertions, 14 deletions
diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c
index f020e6d3..739e6fc1 100644
--- a/src/librc/librc-depend.c
+++ b/src/librc/librc-depend.c
@@ -197,7 +197,7 @@ valid_service(const char *runlevel, const char *service, const char *type)
}
state = rc_service_state(service);
- if (state & RC_SERVICE_COLDPLUGGED ||
+ if (state & RC_SERVICE_HOTPLUGGED ||
state & RC_SERVICE_STARTED)
return true;
@@ -207,7 +207,7 @@ valid_service(const char *runlevel, const char *service, const char *type)
static bool
get_provided1(const char *runlevel, RC_STRINGLIST *providers,
RC_DEPTYPE *deptype, const char *level,
- bool coldplugged, RC_SERVICE state)
+ bool hotplugged, RC_SERVICE state)
{
RC_STRING *service;
RC_SERVICE st;
@@ -222,8 +222,8 @@ get_provided1(const char *runlevel, RC_STRINGLIST *providers,
if (level)
ok = rc_service_in_runlevel(svc, level);
- else if (coldplugged)
- ok = (st & RC_SERVICE_COLDPLUGGED &&
+ else if (hotplugged)
+ ok = (st & RC_SERVICE_HOTPLUGGED &&
!rc_service_in_runlevel(svc, runlevel) &&
!rc_service_in_runlevel(svc, bootlevel));
if (!ok)
@@ -281,13 +281,13 @@ get_provided(const RC_DEPINFO *depinfo, const char *runlevel, int options)
}
/* If we're strict or starting, then only use what we have in our
- * runlevel and bootlevel. If we starting then check cold-plugged too. */
+ * runlevel and bootlevel. If we starting then check hotplugged too. */
if (options & RC_DEP_STRICT || options & RC_DEP_START) {
TAILQ_FOREACH(service, dt->services, entries)
if (rc_service_in_runlevel(service->value, runlevel) ||
rc_service_in_runlevel(service->value, bootlevel) ||
(options & RC_DEP_START &&
- rc_service_state(service->value) & RC_SERVICE_COLDPLUGGED))
+ rc_service_state(service->value) & RC_SERVICE_HOTPLUGGED))
rc_stringlist_add(providers, service->value);
if (TAILQ_FIRST(providers))
return providers;
@@ -301,7 +301,7 @@ get_provided(const RC_DEPINFO *depinfo, const char *runlevel, int options)
* We apply this to these states in order:-
* started, starting | stopping | inactive, stopped
* Our sub preference in each of these is in order:-
- * runlevel, coldplugged, bootlevel, any
+ * runlevel, hotplugged, bootlevel, any
*/
#define DO \
if (TAILQ_FIRST(providers)) { \
@@ -515,7 +515,7 @@ rc_deptree_order(const RC_DEPTREE *deptree, const char *runlevel, int options)
list2 = rc_services_in_runlevel(runlevel);
TAILQ_CONCAT(list, list2, entries);
free(list2);
- list2 = rc_services_in_state(RC_SERVICE_COLDPLUGGED);
+ list2 = rc_services_in_state(RC_SERVICE_HOTPLUGGED);
TAILQ_CONCAT(list, list2, entries);
free(list2);
/* If we're not the boot runlevel then add that too */
@@ -626,7 +626,7 @@ static const char *const depdirs[] =
RC_SVCDIR "/inactive",
RC_SVCDIR "/wasinactive",
RC_SVCDIR "/failed",
- RC_SVCDIR "/coldplugged",
+ RC_SVCDIR "/hotplugged",
RC_SVCDIR "/daemons",
RC_SVCDIR "/options",
RC_SVCDIR "/exclusive",
diff --git a/src/librc/librc.c b/src/librc/librc.c
index b625b06a..b355d7f5 100644
--- a/src/librc/librc.c
+++ b/src/librc/librc.c
@@ -59,7 +59,7 @@ static const rc_service_state_name_t rc_service_state_names[] = {
{ RC_SERVICE_STOPPING, "stopping" },
{ RC_SERVICE_INACTIVE, "inactive" },
{ RC_SERVICE_WASINACTIVE, "wasinactive" },
- { RC_SERVICE_COLDPLUGGED, "coldplugged" },
+ { RC_SERVICE_HOTPLUGGED, "hotplugged" },
{ RC_SERVICE_FAILED, "failed" },
{ RC_SERVICE_SCHEDULED, "scheduled"},
{ 0, NULL}
@@ -529,7 +529,7 @@ rc_service_mark(const char *service, const RC_SERVICE state)
skip_state = state;
}
- if (state == RC_SERVICE_COLDPLUGGED || state == RC_SERVICE_FAILED) {
+ if (state == RC_SERVICE_HOTPLUGGED || state == RC_SERVICE_FAILED) {
free(init);
return true;
}
@@ -540,7 +540,7 @@ rc_service_mark(const char *service, const RC_SERVICE state)
if ((s != skip_state &&
s != RC_SERVICE_STOPPED &&
- s != RC_SERVICE_COLDPLUGGED &&
+ s != RC_SERVICE_HOTPLUGGED &&
s != RC_SERVICE_SCHEDULED) &&
(! skip_wasinactive || s != RC_SERVICE_WASINACTIVE))
{
diff --git a/src/librc/rc.h.in b/src/librc/rc.h.in
index 96287144..92fb19c7 100644
--- a/src/librc/rc.h.in
+++ b/src/librc/rc.h.in
@@ -115,8 +115,8 @@ typedef enum
RC_SERVICE_STARTING = 0x0008,
RC_SERVICE_INACTIVE = 0x0010,
- /* Service may or may not have been coldplugged */
- RC_SERVICE_COLDPLUGGED = 0x0100,
+ /* Service may or may not have been hotplugged */
+ RC_SERVICE_HOTPLUGGED = 0x0100,
/* Optional states service could also be in */
RC_SERVICE_FAILED = 0x0200,