aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-16 17:27:13 +0000
committerRoy Marples <roy@marples.name>2008-03-16 17:27:13 +0000
commit40930d7d0a613aaf6fa124a5963afcae0c30ce7a (patch)
tree89b379b4fe5a20a061c05881b75ad93276d80d08
parent1fd1472ddeb4a9e248bd20a378091ffe6f1132b6 (diff)
Use correct TAILQ_CONCAT macro when not defined.
-rw-r--r--src/includes/rc-misc.h5
-rw-r--r--src/librc/librc-depend.c8
-rw-r--r--src/librc/librc.c6
-rw-r--r--src/rc/rc-misc.c2
-rw-r--r--src/rc/rc.c6
-rw-r--r--src/rc/runscript.c2
6 files changed, 15 insertions, 14 deletions
diff --git a/src/includes/rc-misc.h b/src/includes/rc-misc.h
index 0b33c997..9a706175 100644
--- a/src/includes/rc-misc.h
+++ b/src/includes/rc-misc.h
@@ -111,9 +111,10 @@
#endif
#ifndef TAILQ_CONCAT
-#define TAILQ_CONCAT(head1, head2) do { \
- if (!TAILQ_EMPTY((head2))) { \
+#define TAILQ_CONCAT(head1, head2, field) do { \
+ if (!TAILQ_EMPTY(head2)) { \
*(head1)->tqh_last = (head2)->tqh_first; \
+ (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
(head1)->tqh_last = (head2)->tqh_last; \
TAILQ_INIT((head2)); \
} \
diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c
index 8617d753..7038a3fc 100644
--- a/src/librc/librc-depend.c
+++ b/src/librc/librc-depend.c
@@ -522,24 +522,24 @@ RC_STRINGLIST *rc_deptree_order(const RC_DEPTREE *deptree,
list = rc_services_in_state(RC_SERVICE_STARTED);
list2 = rc_services_in_state (RC_SERVICE_INACTIVE);
- TAILQ_CONCAT(list, list2);
+ TAILQ_CONCAT(list, list2, entries);
free(list2);
list2 = rc_services_in_state (RC_SERVICE_STARTING);
- TAILQ_CONCAT(list, list2);
+ TAILQ_CONCAT(list, list2, entries);
free(list2);
} else {
list = rc_services_in_runlevel (runlevel);
/* Add coldplugged services */
list2 = rc_services_in_state (RC_SERVICE_COLDPLUGGED);
- TAILQ_CONCAT(list, list2);
+ TAILQ_CONCAT(list, list2, entries);
free(list2);
/* If we're not the boot runlevel then add that too */
if (strcmp (runlevel, bootlevel) != 0) {
list2 = rc_services_in_runlevel (bootlevel);
- TAILQ_CONCAT(list, list2);
+ TAILQ_CONCAT(list, list2, entries);
free(list2);
}
}
diff --git a/src/librc/librc.c b/src/librc/librc.c
index 301a388a..dfee0bfc 100644
--- a/src/librc/librc.c
+++ b/src/librc/librc.c
@@ -839,13 +839,13 @@ RC_STRINGLIST *rc_services_in_runlevel(const char *runlevel)
#ifdef RC_PKG_INITDIR
if (pkg) {
- TAILQ_CONCAT(list, pkg);
+ TAILQ_CONCAT(list, pkg, entries);
free(pkg);
}
#endif
#ifdef RC_LOCAL_DIR
if (local) {
- TAILQ_CONCAT(list, local);
+ TAILQ_CONCAT(list, local, entries);
free(local);
}
#endif
@@ -883,7 +883,7 @@ RC_STRINGLIST *rc_services_in_state(RC_SERVICE state)
p = rc_strcatpaths(dir, d->value, (char *) NULL);
services = ls_dir(p, LS_INITD);
free(p);
- TAILQ_CONCAT(list, services);
+ TAILQ_CONCAT(list, services, entries);
free(services);
}
rc_stringlist_free(dirs);
diff --git a/src/rc/rc-misc.c b/src/rc/rc-misc.c
index 3167f26b..7c5d1014 100644
--- a/src/rc/rc-misc.c
+++ b/src/rc/rc-misc.c
@@ -79,7 +79,7 @@ char *rc_conf_value(const char *setting)
if (exists(RC_CONF_OLD)) {
old = rc_config_load(RC_CONF_OLD);
if (old) {
- TAILQ_CONCAT(rc_conf, old);
+ TAILQ_CONCAT(rc_conf, old, entries);
free(old);
}
}
diff --git a/src/rc/rc.c b/src/rc/rc.c
index 6a6aa0a4..6754d2d3 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -951,10 +951,10 @@ int main(int argc, char **argv)
* correct order for stopping them */
stop_services = rc_services_in_state(RC_SERVICE_STARTED);
tmplist = rc_services_in_state(RC_SERVICE_INACTIVE);
- TAILQ_CONCAT(stop_services, tmplist);
+ TAILQ_CONCAT(stop_services, tmplist, entries);
free(tmplist);
tmplist = rc_services_in_state(RC_SERVICE_STARTING);
- TAILQ_CONCAT(stop_services, tmplist);
+ TAILQ_CONCAT(stop_services, tmplist, entries);
free(tmplist);
rc_stringlist_sort(&stop_services);
@@ -981,7 +981,7 @@ int main(int argc, char **argv)
start_services = rc_services_in_runlevel(bootlevel);
if (strcmp (newlevel ? newlevel : runlevel, bootlevel) != 0) {
tmplist = rc_services_in_runlevel(newlevel ? newlevel : runlevel);
- TAILQ_CONCAT(start_services, tmplist);
+ TAILQ_CONCAT(start_services, tmplist, entries);
free(tmplist);
}
diff --git a/src/rc/runscript.c b/src/rc/runscript.c
index cfc2611a..e7a094f8 100644
--- a/src/rc/runscript.c
+++ b/src/rc/runscript.c
@@ -627,7 +627,7 @@ static void get_started_services(void)
RC_STRINGLIST *tmp = rc_services_in_state(RC_SERVICE_INACTIVE);
rc_stringlist_free(restart_services);
restart_services = rc_services_in_state(RC_SERVICE_STARTED);
- TAILQ_CONCAT(restart_services, tmp);
+ TAILQ_CONCAT(restart_services, tmp, entries);
free(tmp);
}