Commit 3ba63cc7 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Don't assert on write errors to the child process CLI-pipe, it might

simply be dying on us.  Instead return the designed error code for
this: CLIS_COMM 

Fixes	#639



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4517 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 3ea28b8b
......@@ -175,9 +175,19 @@ mcf_askchild(struct cli *cli, const char * const *av, void *priv)
}
AN(cli->cmd);
i = write(cli_o, cli->cmd, strlen(cli->cmd));
xxxassert(i == strlen(cli->cmd));
if (i != strlen(cli->cmd)) {
cli_result(cli, CLIS_COMMS);
cli_out(cli, "CLI communication error");
return;
}
i = write(cli_o, "\n", 1);
xxxassert(i == 1);
if (i != 1) {
cli_result(cli, CLIS_COMMS);
cli_out(cli, "CLI communication error");
return;
}
assert(i == 1 || errno == EPIPE);
(void)cli_readres(cli_i,
&u, &q, params->cli_timeout);
cli_result(cli, 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