make variable aflag a boolean show_all

This commit is contained in:
William Hubbs 2016-07-14 12:13:17 -05:00
parent 7f84b5d741
commit 20035210bd

View File

@ -176,9 +176,9 @@ print_stacked_services(const char *runlevel)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
RC_STRING *s, *l, *t, *level; RC_STRING *s, *l, *t, *level;
bool show_all = false;
char *p, *runlevel = NULL; char *p, *runlevel = NULL;
int opt, aflag = 0, retval = 0; int opt, retval = 0;
test_crashed = _rc_can_find_pids(); test_crashed = _rc_can_find_pids();
@ -187,7 +187,7 @@ int main(int argc, char **argv)
(int *) 0)) != -1) (int *) 0)) != -1)
switch (opt) { switch (opt) {
case 'a': case 'a':
aflag++; show_all = true;
levels = rc_runlevel_list(); levels = rc_runlevel_list();
break; break;
case 'c': case 'c':
@ -265,7 +265,7 @@ int main(int argc, char **argv)
services = NULL; services = NULL;
} }
if (aflag || argc < 2) { if (show_all || argc < 2) {
/* Show hotplugged services */ /* Show hotplugged services */
print_level("Dynamic", "hotplugged"); print_level("Dynamic", "hotplugged");
services = rc_services_in_state(RC_SERVICE_HOTPLUGGED); services = rc_services_in_state(RC_SERVICE_HOTPLUGGED);
@ -274,7 +274,7 @@ int main(int argc, char **argv)
services = NULL; services = NULL;
/* Show manually started and unassigned depended services */ /* Show manually started and unassigned depended services */
if (aflag) { if (show_all) {
rc_stringlist_free(levels); rc_stringlist_free(levels);
levels = rc_stringlist_new(); levels = rc_stringlist_new();
if (!runlevel) if (!runlevel)