aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-04-16 19:47:19 +0000
committerRoy Marples <roy@marples.name>2008-04-16 19:47:19 +0000
commit425abe40c5b511e684efe508972b9036462a2358 (patch)
tree55f7b4c00d2c2fb20f002663862fe4ec5b0d5ff2
parent725b9dc89c59248c4503f27e62dcd1333001c082 (diff)
Only report unassigned services when there are any, Gentoo #218005.
-rw-r--r--src/rc/rc-status.c7
1 files 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) {