summaryrefslogtreecommitdiffstats
path: root/lib/command.c
diff options
context:
space:
mode:
authorSteve Hill <quagga@cheesy.sackheads.org>2009-07-22 17:18:56 +0000
committerDavid Lamparter <equinox@diac24.net>2010-02-04 21:28:37 +0100
commit6c9463d3f240f79fd46665c3b21e5152e51804f5 (patch)
tree36fc845873ccddc8624c077057096a57b55e48c8 /lib/command.c
parent31aaf4f14898cd9076aa9d128ca1aef6c73db37c (diff)
downloadquagga-6c9463d3f240f79fd46665c3b21e5152e51804f5.tar.bz2
quagga-6c9463d3f240f79fd46665c3b21e5152e51804f5.tar.xz
lib: Improve error reporting from broken config files
cleans up a few items with error reporting at startup: - Line numbers are now reported alongside error text - All errors now go to stderr instead of some stderr and some stdout - The vty buffer is flushed so that errors now come out in the right order
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/command.c b/lib/command.c
index e79d462e..ce7a989f 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2264,13 +2264,15 @@ cmd_execute_command_strict (vector vline, struct vty *vty,
/* Configration make from file. */
int
-config_from_file (struct vty *vty, FILE *fp)
+config_from_file (struct vty *vty, FILE *fp, unsigned int *line_num)
{
int ret;
+ *line_num = 0;
vector vline;
while (fgets (vty->buf, VTY_BUFSIZ, fp))
{
+ ++(*line_num);
vline = cmd_make_strvec (vty->buf);
/* In case of comment line */