aboutsummaryrefslogtreecommitdiff
path: root/src/comp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/comp.c b/src/comp.c
index 539db93..5613e28 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -47,3 +47,3 @@ prev_index (void)
void
-component_link (struct component *comp, struct component *ref, int before)
+component_link (struct component *comp, struct component *ref)
{
@@ -53,12 +53,10 @@ component_link (struct component *comp, struct component *ref, int before)
- comp->next = NULL;
- comp->prev = list->tail;
- if (list->tail)
- list->tail->next = comp;
+ comp->prev = NULL;
+ comp->next = list->head;
+ if (list->head)
+ list->head->prev = comp;
else
- list->head = comp;
- list->tail = comp;
+ list->tail = comp;
+ list->head = comp;
}
- else if (before)
- component_link (comp, ref->prev, 0);
else
@@ -83,2 +81,8 @@ component_link (struct component *comp, struct component *ref, int before)
void
+component_append (struct component *comp)
+{
+ component_link (comp, comp_list[comp->listidx].tail);
+}
+
+void
component_unlink (struct component *comp)
@@ -134,3 +138,3 @@ component_create (const char *name)
comp->socket_type = SOCK_STREAM;
- component_link (comp, NULL, 0);
+ component_append (comp);
}
@@ -166,3 +170,2 @@ component_free (struct component *comp)
free_limits (comp->limits);
- free (comp->runlevels);
free (comp->service);
@@ -489,3 +492,3 @@ component_config_commit (void)
match->listidx = cur;
- component_link (match, comp, 1);
+ component_link (match, comp->prev);
component_free (comp);

Return to:

Send suggestions and report system problems to the System administrator.