Commit 020c5a62 authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Split pushing of VCLs and starting the acceptor

This is so that errors in either will be reported under the right heading.
parent 373388bb
......@@ -213,7 +213,7 @@ char *mgt_VccCompile(struct cli *, struct vclprog *, const char *vclname,
void mgt_vcl_init(void);
void mgt_vcl_startup(struct cli *, const char *vclsrc, const char *origin,
const char *vclname, int Cflag);
int mgt_push_vcls_and_start(struct cli *, unsigned *status, char **p);
int mgt_push_vcls(struct cli *, unsigned *status, char **p);
void mgt_vcl_export_labels(struct vcc *);
int mgt_has_vcl(void);
void mgt_vcl_depends(struct vclprog *vp1, const char *name);
......
......@@ -395,15 +395,25 @@ mgt_launch_child(struct cli *cli)
mgt_cli_start_child(child_cli_in, child_cli_out);
child_pid = pid;
if (mgt_push_vcls_and_start(cli, &u, &p)) {
child_state = CH_RUNNING;
if (mgt_push_vcls(cli, &u, &p)) {
VCLI_SetResult(cli, u);
MGT_Complain(C_ERR, "Child (%jd) Pushing vcls failed:\n%s",
(intmax_t)child_pid, p);
free(p);
child_state = CH_RUNNING;
MCH_Stop_Child();
} else
child_state = CH_RUNNING;
return;
}
if (mgt_cli_askchild(&u, &p, "start\n")) {
VCLI_SetResult(cli, u);
MGT_Complain(C_ERR, "Child (%jd) Acceptor start failed:\n%s",
(intmax_t)child_pid, p);
free(p);
MCH_Stop_Child();
return;
}
}
/*=====================================================================
......
......@@ -545,7 +545,7 @@ mgt_vcl_export_labels(struct vcc *vcc)
/*--------------------------------------------------------------------*/
int
mgt_push_vcls_and_start(struct cli *cli, unsigned *status, char **p)
mgt_push_vcls(struct cli *cli, unsigned *status, char **p)
{
struct vclprog *vp;
struct vcldep *vd;
......@@ -594,10 +594,6 @@ mgt_push_vcls_and_start(struct cli *cli, unsigned *status, char **p)
return (1);
free(*p);
*p = NULL;
if (mgt_cli_askchild(status, p, "start\n"))
return (1);
free(*p);
*p = NULL;
return (0);
}
......
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