summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornorly <ny-git@enpas.org>2016-12-17 03:25:50 +0100
committernorly <ny-git@enpas.org>2016-12-17 03:25:50 +0100
commit659b78f629cf79605731ead12597ca5a2946ffa4 (patch)
treee289d4544c247b58253469911471a42be2817350
parentf9dceee770164d03b51270e567978624282d5996 (diff)
More compact state dump
-rw-r--r--vw-nm.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/vw-nm.c b/vw-nm.c
index 0802ede..975956c 100644
--- a/vw-nm.c
+++ b/vw-nm.c
@@ -70,7 +70,7 @@ static char* nm_main_to_string(NM_State state)
case NM_MAIN_OFF:
return "Off";
case NM_MAIN_ON:
- return "On/Ready";
+ return "Ready";
case NM_MAIN_LOGIN:
return "Login";
case NM_MAIN_LIMPHOME:
@@ -101,20 +101,23 @@ static void nm_dump_all(struct NM_Main *nm)
unsigned id;
printf("\n");
- printf("Current system state:\n");
- printf("\n");
+ printf(" Node | next | Main | Sleep\n");
+ printf("----------------------------------------\n");
for (id = 0; id < nm->max_nodes; id++) {
struct NM_Node *node = &nm->nodes[id];
if (node->state & NM_MAIN_MASK) {
- printf("Active node %02x:\n", id);
- printf(" Next: %02x\n", node->next);
- printf(" Main: %s\n", nm_main_to_string(node->state));
- printf(" Sleep: %s\n", nm_sleep_to_string(node->state));
- printf("\n");
+ printf(" %02x %02x % 9s %s\n",
+ id,
+ node->next,
+ nm_main_to_string(node->state),
+ nm_sleep_to_string(node->state));
+
}
}
+
+ printf("\n");
}