summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-06-14 09:21:11 -0400
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-08-14 20:02:05 +0000
commitab99c8e2b87e9d0ecfb91f6a05010948f9949cee (patch)
tree539b3fbb8c0f4abb52328dcee47d8baa4eba0ec5 /lib/vty.c
parent481bc15ffcebcc7d0395a3ffa8ce70249e221d5b (diff)
lib: Add LIB_ERR_VTY
Add a error code for when the vty subsystem detects an error. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 0b431a5c7f..d591ef4b5b 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -40,6 +40,7 @@
#include "network.h"
#include "libfrr.h"
#include "frrstr.h"
+#include "lib_errors.h"
#include <arpa/telnet.h>
#include <termios.h>
@@ -2412,8 +2413,9 @@ static void vty_read_file(FILE *confp)
nl = strchr(vty->error_buf, '\n');
if (nl)
*nl = '\0';
- zlog_err("ERROR: %s on config line %u: %s", message, line_num,
- vty->error_buf);
+ zlog_ferr(LIB_ERR_VTY,
+ "ERROR: %s on config line %u: %s", message, line_num,
+ vty->error_buf);
}
vty_close(vty);
@@ -2509,8 +2511,9 @@ bool vty_read_config(const char *config_file, char *config_default_dir)
zlog_warn(
"WARNING: using backup configuration file!");
else {
- zlog_err("can't open configuration file [%s]",
- config_file);
+ zlog_ferr(LIB_ERR_VTY,
+ "can't open configuration file [%s]",
+ config_file);
exit(1);
}
}
@@ -2556,8 +2559,9 @@ bool vty_read_config(const char *config_file, char *config_default_dir)
"WARNING: using backup configuration file!");
fullpath = config_default_dir;
} else {
- zlog_err("can't open configuration file [%s]",
- config_default_dir);
+ zlog_ferr(LIB_ERR_VTY,
+ "can't open configuration file [%s]",
+ config_default_dir);
goto tmp_free_and_out;
}
} else