Commit 1d7cdadd authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

vsm: Centralize VARNISH_DEFAULT_N fallback

Putting the new fallback next to the historical fallback.

Refs #4105
parent 39a29a52
......@@ -467,7 +467,6 @@ main(int argc, char * const *argv)
printf(OPTARG "\n");
exit(0);
}
n_arg = getenv("VARNISH_DEFAULT_N");
/*
* By default linux::getopt(3) mangles the argv order, such that
* varnishadm -n bla param.set foo -bar
......
......@@ -346,8 +346,6 @@ VSM_New(void)
ALLOC_OBJ(vd, VSM_MAGIC);
AN(vd);
REPLACE(vd->wdname, getenv("VARNISH_DEFAULT_N"));
vd->mgt = vsm_newset(VSM_MGT_DIRNAME);
vd->mgt->flag_running = VSM_MGT_RUNNING;
vd->mgt->flag_changed = VSM_MGT_CHANGED;
......@@ -756,6 +754,9 @@ VSM_Attach(struct vsm *vd, int progress)
else
t0 = VTIM_mono() + vd->patience;
if (vd->wdname == NULL)
REPLACE(vd->wdname, getenv("VARNISH_DEFAULT_N"));
if (vd->wdname == NULL) {
/* Use default (hostname) */
i = VSM_Arg(vd, 'n', "");
......
......@@ -263,7 +263,6 @@ VUT_Init(const char *progname, int argc, char * const *argv,
AZ(vut->vsl);
vut->vsl = VSL_New();
AN(vut->vsl);
REPLACE(vut->n_arg, getenv("VARNISH_DEFAULT_N"));
return (vut);
}
......
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