diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-22 12:31:56 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2016-02-22 12:33:46 +0200 |
commit | bfa3617a79292e3569587c65cd218b69bdfd28a2 (patch) | |
tree | 8b094ec15dbb50be7324b3aa2f0d7486146a04d3 /src/comp.c | |
parent | a9bd91de478ab29fa7bac2093479a1ccee1bbd87 (diff) | |
download | pies-bfa3617a79292e3569587c65cd218b69bdfd28a2.tar.gz pies-bfa3617a79292e3569587c65cd218b69bdfd28a2.tar.bz2 |
Provide a default single-user entry in init mode
This complements 6aac230c. The entry is created unless
a component for runlevel S already exists.
* src/comp.c (component_foreach): New function.
* src/pies.h: Likewise.
* src/sysvinit.c (inittab_parse): Provide default S
entry unless one is already defined.
Diffstat (limited to 'src/comp.c')
-rw-r--r-- | src/comp.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -814,2 +814,19 @@ component_depmap_next (pies_depmap_pos_t pos) } + +int +component_foreach (int (*filter) (struct component *, void *), void *data) +{ + struct component *comp; + int rc = 0; + struct complist *list = &comp_list[cur]; + + for (comp = list->head; comp; ) + { + struct component *next = comp->next; + if ((rc = filter (comp, data)) != 0) + break; + comp = next; + } + return rc; +} |