diff options
Diffstat (limited to 'src/comp.c')
-rw-r--r-- | src/comp.c | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -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); |