aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rc/rc-status.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/rc/rc-status.c b/src/rc/rc-status.c
index cebdc5ed..56395873 100644
--- a/src/rc/rc-status.c
+++ b/src/rc/rc-status.c
@@ -167,6 +167,9 @@ print_service(const char *service)
} else if (state & RC_SERVICE_SCHEDULED) {
xasprintf(&status, "scheduled");
color = ECOLOR_WARN;
+ } else if (state & RC_SERVICE_FAILED) {
+ xasprintf(&status, "failed");
+ color = ECOLOR_WARN;
} else
xasprintf(&status, " stopped ");
@@ -238,6 +241,7 @@ print_stacked_services(const char *runlevel)
int main(int argc, char **argv)
{
+ RC_SERVICE state;
RC_STRING *s, *l, *t, *level;
bool show_all = false;
char *p, *runlevel = NULL;
@@ -373,11 +377,14 @@ int main(int argc, char **argv)
free(nservices);
}
TAILQ_FOREACH_SAFE(s, services, entries, t) {
+ state = rc_service_state(s->value);
if ((rc_stringlist_find(sservices, s->value) ||
- (rc_service_state(s->value) & ( RC_SERVICE_STOPPED | RC_SERVICE_HOTPLUGGED)))) {
- TAILQ_REMOVE(services, s, entries);
- free(s->value);
- free(s);
+ (state & ( RC_SERVICE_STOPPED | RC_SERVICE_HOTPLUGGED)))) {
+ if (! (state & RC_SERVICE_FAILED)) {
+ TAILQ_REMOVE(services, s, entries);
+ free(s->value);
+ free(s);
+ }
}
}
needsme = rc_stringlist_new();