From 425abe40c5b511e684efe508972b9036462a2358 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 16 Apr 2008 19:47:19 +0000 Subject: Only report unassigned services when there are any, Gentoo #218005. --- src/rc/rc-status.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rc/rc-status.c b/src/rc/rc-status.c index f79d3392..84c92e03 100644 --- a/src/rc/rc-status.c +++ b/src/rc/rc-status.c @@ -185,7 +185,7 @@ static const char * const longopts_help[] = { int rc_status(int argc, char **argv) { RC_STRINGLIST *levels = NULL; - RC_STRINGLIST *services; + RC_STRINGLIST *services = NULL; RC_STRING *s, *l, *t; char *p; int opt; @@ -256,9 +256,10 @@ int rc_status(int argc, char **argv) } /* Show unassigned running too */ - if (argc < 2) { + if (argc < 2 && + (services = rc_services_in_runlevel(NULL))) + { print_level("UNASSIGNED"); - services = rc_services_in_runlevel(NULL); rc_stringlist_free(levels); levels = rc_runlevel_list(); TAILQ_FOREACH_SAFE(s, services, entries, t) { -- cgit v1.2.3