Commit 4378e46d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

If CLI is NULL, use stdout.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@898 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 75391ffe
......@@ -29,23 +29,30 @@ cli_out(struct cli *cli, const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
vsb_vprintf(cli->sb, fmt, ap);
if (cli != NULL)
vsb_vprintf(cli->sb, fmt, ap);
else
vfprintf(stdout, fmt, ap);
va_end(ap);
}
void
cli_param(struct cli *cli)
cli_result(struct cli *cli, unsigned res)
{
cli->result = CLIS_PARAM;
cli_out(cli, "Parameter error, use \"help [command]\" for more info.\n");
if (cli != NULL)
cli->result = res;
else
printf("CLI result = %d\n", res);
}
void
cli_result(struct cli *cli, unsigned res)
cli_param(struct cli *cli)
{
cli->result = res;
cli_result(cli, CLIS_PARAM);
cli_out(cli, "Parameter error, use \"help [command]\" for more info.\n");
}
int
......
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