summaryrefslogtreecommitdiffstats
path: root/vtysh/vtysh_main.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-04-06 15:34:33 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-04-07 02:07:27 +0200
commit1db63918b2478bc37b12aff584071085c51e6294 (patch)
tree0f9c3b9eee8a17b62b8338543b807cb5dd0022e0 /vtysh/vtysh_main.c
parentlib: Initialize variable (diff)
downloadfrr-1db63918b2478bc37b12aff584071085c51e6294.tar.xz
frr-1db63918b2478bc37b12aff584071085c51e6294.zip
lib, vtysh: Return actual problem further up
When we encounter a problem loading a config file quantify to the end user what has gone wrong, with a combination of err output as well as return codes. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Dave Olson <olson@cumulusnetworks.com>
Diffstat (limited to 'vtysh/vtysh_main.c')
-rw-r--r--vtysh/vtysh_main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index a063425ff..07423287a 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -477,14 +477,15 @@ main (int argc, char **argv, char **env)
/* Boot startup configuration file. */
if (boot_flag)
{
- if (vtysh_read_config (integrate_default))
- {
- fprintf (stderr, "Can't open configuration file [%s]\n",
- integrate_default);
+ int ret = vtysh_read_config (integrate_default);
+ if (ret)
+ {
+ fprintf (stderr, "Configuration file[%s] processing failure: %d\n",
+ integrate_default, ret);
if (no_error)
exit (0);
else
- exit (1);
+ exit (ret);
}
else
exit (0);