Commit 192637a3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make add info to the boot VCL about where it came from, -b or -f argument.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4462 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 22c54a22
...@@ -66,7 +66,7 @@ void MCF_ParamSet(struct cli *, const char *param, const char *val); ...@@ -66,7 +66,7 @@ void MCF_ParamSet(struct cli *, const char *param, const char *val);
/* mgt_vcc.c */ /* mgt_vcc.c */
void mgt_vcc_init(void); void mgt_vcc_init(void);
int mgt_vcc_default(const char *bflag, char *vcl, int Cflag); int mgt_vcc_default(const char *bflag, const char *f_arg, char *vcl, int Cflag);
int mgt_push_vcls_and_start(unsigned *status, char **p); int mgt_push_vcls_and_start(unsigned *status, char **p);
int mgt_has_vcl(void); int mgt_has_vcl(void);
extern char *mgt_cc_cmd; extern char *mgt_cc_cmd;
......
...@@ -325,12 +325,13 @@ mgt_vcc_delbyname(const char *name) ...@@ -325,12 +325,13 @@ mgt_vcc_delbyname(const char *name)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
int int
mgt_vcc_default(const char *b_arg, char *vcl, int C_flag) mgt_vcc_default(const char *b_arg, const char *f_arg, char *vcl, int C_flag)
{ {
char *addr, *port; char *addr, *port;
char *vf; char *vf;
struct vsb *sb; struct vsb *sb;
struct vclprog *vp; struct vclprog *vp;
char buf[BUFSIZ];
if (b_arg != NULL) { if (b_arg != NULL) {
AZ(vcl); AZ(vcl);
...@@ -363,6 +364,9 @@ mgt_vcc_default(const char *b_arg, char *vcl, int C_flag) ...@@ -363,6 +364,9 @@ mgt_vcc_default(const char *b_arg, char *vcl, int C_flag)
free(addr); free(addr);
free(port); free(port);
AN(vcl); AN(vcl);
bprintf(buf, "boot (-b %s)", b_arg);
} else {
brintf(buf, "boot (-f %s)", f_arg);
} }
vf = mgt_VccCompile(&sb, vcl, C_flag); vf = mgt_VccCompile(&sb, vcl, C_flag);
...@@ -379,7 +383,7 @@ mgt_vcc_default(const char *b_arg, char *vcl, int C_flag) ...@@ -379,7 +383,7 @@ mgt_vcc_default(const char *b_arg, char *vcl, int C_flag)
fprintf(stderr, "\nVCL compilation failed\n"); fprintf(stderr, "\nVCL compilation failed\n");
return (1); return (1);
} }
vp = mgt_vcc_add("boot", vf); vp = mgt_vcc_add(buf, vf);
vp->active = 1; vp->active = 1;
return (0); return (0);
} }
......
...@@ -727,7 +727,7 @@ main(int argc, char * const *argv) ...@@ -727,7 +727,7 @@ main(int argc, char * const *argv)
} }
if (b_arg != NULL || f_arg != NULL) if (b_arg != NULL || f_arg != NULL)
if (mgt_vcc_default(b_arg, vcl, C_flag)) if (mgt_vcc_default(b_arg, f_arg, vcl, C_flag))
exit (2); exit (2);
if (C_flag) if (C_flag)
......
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