summaryrefslogtreecommitdiff
path: root/src/rc/rc-status.c
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 /src/rc/rc-status.c
parent725b9dc89c59248c4503f27e62dcd1333001c082 (diff)
downloadopenrc-425abe40c5b511e684efe508972b9036462a2358.tar.gz
openrc-425abe40c5b511e684efe508972b9036462a2358.tar.bz2
openrc-425abe40c5b511e684efe508972b9036462a2358.tar.xz
Only report unassigned services when there are any, Gentoo #218005.
Diffstat (limited to 'src/rc/rc-status.c')
-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 f79d339..84c92e0 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) {