diff options
| author | Russ White <russ@riw.us> | 2019-07-30 10:58:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-30 10:58:45 -0400 |
| commit | 65c52bd33dbbdaf293a885bb0aa8d2b86bb60f87 (patch) | |
| tree | 5cfdede794f26dd3b1a7d6891aef1b230492fbc3 /lib/ferr.c | |
| parent | 0db38652f79dcfc67e0c43fb6b0c3927a4ca1aa3 (diff) | |
| parent | 2d6e4d2ebcb30219ec204d30332a3c126cadbceb (diff) | |
Merge pull request #4732 from qlyoung/ercode-oncec
vtysh: only show error codes once
Diffstat (limited to 'lib/ferr.c')
| -rw-r--r-- | lib/ferr.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/ferr.c b/lib/ferr.c index 65c0cf886d..8afc926c41 100644 --- a/lib/ferr.c +++ b/lib/ferr.c @@ -126,10 +126,8 @@ void log_ref_display(struct vty *vty, uint32_t code, bool json) if (code) { ref = log_ref_get(code); - if (!ref) { - vty_out(vty, "Code %"PRIu32" - Unknown\n", code); + if (!ref) return; - } listnode_add(errlist, ref); } @@ -197,8 +195,6 @@ void log_ref_init(void) "Error Reference Texts"); } pthread_mutex_unlock(&refs_mtx); - - install_element(VIEW_NODE, &show_error_code_cmd); } void log_ref_fini(void) @@ -212,6 +208,12 @@ void log_ref_fini(void) pthread_mutex_unlock(&refs_mtx); } +void log_ref_vty_init(void) +{ + install_element(VIEW_NODE, &show_error_code_cmd); +} + + const struct ferr *ferr_get_last(ferr_r errval) { struct ferr *last_error = pthread_getspecific(errkey); |
