diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-01-19 00:59:33 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-02-15 15:21:31 +0100 |
commit | 9abc652b5e7fe2a84ad8efd8b36c6fb42b9cb316 (patch) | |
tree | f43eaaf7a6253f5c57a9c8f86d15015babe0ecbb /src/libbsc/bsc_vty.c | |
parent | 91004ab734d87e4ce04e6ffaa9c69387330c703d (diff) |
vty: 'show bts': write '(none)' if none are found.
Change-Id: I77039824b85a14b9d7bdfe6d2f717679b6886915
Diffstat (limited to 'src/libbsc/bsc_vty.c')
-rw-r--r-- | src/libbsc/bsc_vty.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index f1cbb5402..6415df9c7 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -169,6 +169,7 @@ static void dump_pchan_load_vty(struct vty *vty, char *prefix, const struct pchan_load *pl) { int i; + int dumped = 0; for (i = 0; i < ARRAY_SIZE(pl->pchan); i++) { const struct load_counter *lc = &pl->pchan[i]; @@ -182,7 +183,10 @@ static void dump_pchan_load_vty(struct vty *vty, char *prefix, vty_out(vty, "%s%20s: %3u%% (%u/%u)%s", prefix, gsm_pchan_name(i), percent, lc->used, lc->total, VTY_NEWLINE); + dumped ++; } + if (!dumped) + vty_out(vty, "%s(none)%s", prefix, VTY_NEWLINE); } static void net_dump_vty(struct vty *vty, struct gsm_network *net) |