Commit 2144dc78 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Use better criteria for determining if child CLI connection is hosed.

parent 10bfefca
...@@ -171,7 +171,8 @@ mcf_askchild(struct cli *cli, const char * const *av, void *priv) ...@@ -171,7 +171,8 @@ mcf_askchild(struct cli *cli, const char * const *av, void *priv)
return; return;
} }
VSB_delete(vsb); VSB_delete(vsb);
(void)VCLI_ReadResult(cli_i, &u, &q, mgt_param.cli_timeout); if (VCLI_ReadResult(cli_i, &u, &q, mgt_param.cli_timeout))
MGT_Child_Cli_Fail();
VCLI_SetResult(cli, u); VCLI_SetResult(cli, u);
VCLI_Out(cli, "%s", q); VCLI_Out(cli, "%s", q);
free(q); free(q);
...@@ -220,11 +221,10 @@ mgt_cli_askchild(unsigned *status, char **resp, const char *fmt, ...) { ...@@ -220,11 +221,10 @@ mgt_cli_askchild(unsigned *status, char **resp, const char *fmt, ...) {
return (CLIS_COMMS); return (CLIS_COMMS);
} }
(void)VCLI_ReadResult(cli_i, &u, resp, mgt_param.cli_timeout); if (VCLI_ReadResult(cli_i, &u, resp, mgt_param.cli_timeout))
MGT_Child_Cli_Fail();
if (status != NULL) if (status != NULL)
*status = u; *status = u;
if (u == CLIS_COMMS)
MGT_Child_Cli_Fail();
return (u == CLIS_OK ? 0 : u); return (u == CLIS_OK ? 0 : u);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment