diff --git a/tools/vsh.c b/tools/vsh.c index 540c78ca8597e7eb5a2e07626af9a0188378bbae..400b94eb041c63044c277781c7966020fbbc26cb 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2963,7 +2963,7 @@ vshReadline(vshControl *ctl, const char *prompt) /* * Initialize debug settings. */ -static void +static int vshInitDebug(vshControl *ctl) { const char *debugEnv; @@ -2991,6 +2991,8 @@ vshInitDebug(vshControl *ctl) vshOpenLogFile(ctl); } } + + return 0; } @@ -3013,9 +3015,9 @@ vshInit(vshControl *ctl, const vshCmdGrp *groups, const vshCmdDef *set) cmdGroups = groups; cmdSet = set; - vshInitDebug(ctl); - if (ctl->imode && vshReadlineInit(ctl) < 0) + if (vshInitDebug(ctl) < 0 || + (ctl->imode && vshReadlineInit(ctl) < 0)) return false; return true; @@ -3030,7 +3032,8 @@ vshInitReload(vshControl *ctl) return false; } - vshInitDebug(ctl); + if (vshInitDebug(ctl) < 0) + return false; if (ctl->imode) vshReadlineDeinit(ctl);