diff options
author | Roy Marples <roy@marples.name> | 2007-09-18 12:04:51 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2007-09-18 12:04:51 +0000 |
commit | 936dc943512289a2692aa12ff666f6dd06b00d86 (patch) | |
tree | fdfe2dea1fa722136419bec0ad3e2d08a14b691f /src/librc-depend.c | |
parent | f1bba128929778c21168e84b8970f6623611dc6e (diff) |
API change! rc_ls_dir, rc_get_config and rc_get_list no longer take
a starting list as a first argument. Instead, use rc_strlist_join
to append or prepend the new list to an existing list.
Diffstat (limited to 'src/librc-depend.c')
-rw-r--r-- | src/librc-depend.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/librc-depend.c b/src/librc-depend.c index 16337240..b5c11ad6 100644 --- a/src/librc-depend.c +++ b/src/librc-depend.c @@ -492,25 +492,26 @@ char **rc_order_services (rc_depinfo_t *deptree, const char *runlevel, strcmp (runlevel, RC_LEVEL_SHUTDOWN) == 0 || strcmp (runlevel, RC_LEVEL_REBOOT) == 0) { - list = rc_ls_dir (list, RC_SVCDIR_STARTING, RC_LS_INITD); - list = rc_ls_dir (list, RC_SVCDIR_INACTIVE, RC_LS_INITD); - list = rc_ls_dir (list, RC_SVCDIR_STARTED, RC_LS_INITD); + list = rc_ls_dir (RC_SVCDIR_STARTING, RC_LS_INITD); + list = rc_strlist_join (list, + rc_ls_dir (RC_SVCDIR_INACTIVE, RC_LS_INITD)); + list = rc_strlist_join (list, + rc_ls_dir (RC_SVCDIR_STARTED, RC_LS_INITD)); reverse = true; - } - else - { + } else { list = rc_services_in_runlevel (runlevel); /* Add coldplugged services */ - list = rc_ls_dir (list, RC_SVCDIR_COLDPLUGGED, RC_LS_INITD); + list = rc_strlist_join (list, + rc_ls_dir (RC_SVCDIR_COLDPLUGGED, RC_LS_INITD)); /* If we're not the boot runlevel then add that too */ - if (strcmp (runlevel, bootlevel) != 0) - { + if (strcmp (runlevel, bootlevel) != 0) { char *path = rc_strcatpaths (RC_RUNLEVELDIR, bootlevel, (char *) NULL); - list = rc_ls_dir (list, path, RC_LS_INITD); + list = rc_strlist_join (list, + rc_ls_dir (path, RC_LS_INITD)); free (path); } } @@ -551,7 +552,7 @@ static bool is_newer_than (const char *file, const char *target) if (rc_is_dir (target)) { - char **targets = rc_ls_dir (NULL, target, 0); + char **targets = rc_ls_dir (target, 0); char *t; int i; bool newer = true; @@ -651,7 +652,7 @@ int rc_update_deptree (bool force) if (! rc_exists (RC_DEPCONFIG)) return 0; - config = rc_get_list (NULL, RC_DEPCONFIG); + config = rc_get_list (RC_DEPCONFIG); STRLIST_FOREACH (config, service, i) { if (! is_newer_than (RC_DEPTREE, service)) { newer = true; |