aboutsummaryrefslogtreecommitdiff
path: root/src/librc-depend.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-12-05 17:48:07 +0000
committerRoy Marples <roy@marples.name>2007-12-05 17:48:07 +0000
commit0490a9290a6af4a4923cc79fd380bc00a0a702e3 (patch)
tree5848bf69e4dc0357cc092ed30c974d20154c6469 /src/librc-depend.c
parentf40f7528be64269af7a5401af95dd37d398a5b31 (diff)
Remove rc_service_wait as runscript.c should do the waiting. rc_deptree_depend now returns the exact depends as listed. This is so we can support a new 'keywords' directive. We can add whatever here, like 'notimeout' which means that an init script doesn't timeout. This removes the hardcoded check on checkfs and checkroot.
Diffstat (limited to 'src/librc-depend.c')
-rw-r--r--src/librc-depend.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/librc-depend.c b/src/librc-depend.c
index 5f0cacbb..ee6c79b7 100644
--- a/src/librc-depend.c
+++ b/src/librc-depend.c
@@ -467,10 +467,34 @@ static void visit_service (rc_depinfo_t *deptree, const char * const *types,
rc_strlist_add (&sorted->list, depinfo->service);
}
+char **rc_deptree_depend (rc_depinfo_t *deptree,
+ const char *service, const char *type)
+{
+ rc_depinfo_t *di;
+ rc_deptype_t *dt;
+ char **svcs = NULL;
+ int i;
+ char *svc;
+
+ if (! (di = get_depinfo (deptree, service)) ||
+ ! (dt = get_deptype (di, type)))
+ {
+ errno = ENOENT;
+ return (NULL);
+ }
+
+ /* For consistency, we copy the array */
+ STRLIST_FOREACH (dt->services, svc, i)
+ rc_strlist_add (&svcs, svc);
+
+ return (svcs);
+}
+librc_hidden_def(rc_deptree_depend)
+
char **rc_deptree_depends (rc_depinfo_t *deptree,
const char **types, const char **services,
const char *runlevel, int options)
-{
+{
struct lhead sorted;
struct lhead visited;
rc_depinfo_t *di;