From 6aac230ce3d21f1e71333ec3863c7ea1afd051c3 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Sun, 21 Feb 2016 12:40:53 +0200 Subject: Provide fall-back entry in init mode * src/sysvinit.c (inittab_parse): Provide default entry if inittab cannot be read or if it defined no components. * src/comp.c (component_list_is_empty): New function. * src/pies.c (pies_read_config): Always return 0 in init mode. (main): Use LOG_DAEMON in init mode. * src/pies.h (component_list_is_empty): New proto. --- src/comp.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/comp.c') diff --git a/src/comp.c b/src/comp.c index 5ddac36..38e440e 100644 --- a/src/comp.c +++ b/src/comp.c @@ -100,6 +100,12 @@ component_unlink (struct component *comp) list->tail = comp->prev; } +int +component_list_is_empty (void) +{ + return !comp_list[cur].head; +} + struct component * component_lookup_tag (int idx, const char *tag) { -- cgit v1.2.1