summaryrefslogtreecommitdiff
path: root/lib/src/svc_tsort.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-04-11 16:07:20 +0200
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-04-11 16:08:25 +0200
commit71d98c150f6242fcf1b8a5845e46db56caad3885 (patch)
tree96cc861544c214039eb61cf38df170a6d9190acb /lib/src/svc_tsort.c
parent4ee0ea9754d4c8103a623c90c03b68457c71581f (diff)
Don't split dependencies into argument vector, keep list of strings
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Diffstat (limited to 'lib/src/svc_tsort.c')
-rw-r--r--lib/src/svc_tsort.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/src/svc_tsort.c b/lib/src/svc_tsort.c
index dcd1b4c..5f83fa0 100644
--- a/lib/src/svc_tsort.c
+++ b/lib/src/svc_tsort.c
@@ -24,21 +24,20 @@
static bool has_dependencies(service_t *list, service_t *svc)
{
- size_t i;
+ const char *ptr;
+ int i;
while (list != NULL) {
- if (svc->after != NULL) {
- for (i = 0; svc->after[i] != NULL; ++i) {
- if (!strcmp(svc->after[i], list->name))
- return true;
- }
+ for (ptr = svc->after, i = 0; i < svc->num_after; ++i) {
+ if (!strcmp(ptr, list->name))
+ return true;
+ ptr += strlen(ptr) + 1;
}
- if (list->before != NULL) {
- for (i = 0; list->before[i] != NULL; ++i) {
- if (!strcmp(list->before[i], svc->name))
- return true;
- }
+ for (ptr = list->before, i = 0; i < list->num_before; ++i) {
+ if (!strcmp(ptr, svc->name))
+ return true;
+ ptr += strlen(ptr) + 1;
}
list = list->next;