From 1db63918b2478bc37b12aff584071085c51e6294 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Wed, 6 Apr 2016 09:34:33 -0400 Subject: 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 Reviewed-by: Don Slice Reviewed-by: Daniel Walton Reviewed-by: Dave Olson --- vtysh/vtysh_main.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'vtysh/vtysh_main.c') 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); -- cgit v1.2.3