Commit 6b4f2d5f authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Give 'exit' CLI command some bite. we may want to be more careful

later on.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@437 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent fedda2c3
......@@ -8,6 +8,7 @@ extern struct event_base *mgt_eb;
void mgt_child_start(void);
void mgt_child_stop(void);
void mgt_child_kill(void);
void mgt_sigchld(int, short, void *);
typedef void mgt_ccb_f(unsigned, const char *, void *);
......
......@@ -282,6 +282,16 @@ mgt_child_stop(void)
/*--------------------------------------------------------------------*/
void
mgt_child_kill(void)
{
desired = H_STOP;
kill(child_pid, 9);
}
/*--------------------------------------------------------------------*/
void
mgt_sigchld(int a, short b, void *c)
{
......
......@@ -239,6 +239,16 @@ m_cli_func_server_stop(struct cli *cli, char **av, void *priv)
/*--------------------------------------------------------------------*/
static void
m_cli_func_exit(struct cli *cli, char **av, void *priv)
{
mgt_child_kill();
exit (0);
}
/*--------------------------------------------------------------------*/
static void
m_cli_func_verbose(struct cli *cli, char **av, void *priv)
{
......@@ -304,7 +314,7 @@ static struct cli_proto cli_proto[] = {
{ CLI_ZERO },
{ CLI_HELP, cli_func_help, cli_proto },
{ CLI_VERBOSE, m_cli_func_verbose, NULL },
{ CLI_EXIT },
{ CLI_EXIT, m_cli_func_exit, NULL},
{ CLI_QUIT },
{ CLI_BYE },
{ NULL }
......
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