Skip to content

Commit

Permalink
vsm: Pass VARNISH_DEFAULT_N to VSM_Arg()
Browse files Browse the repository at this point in the history
It should be resolved like the argument of a -n option.

Refs 1d7cdad
  • Loading branch information
dridi committed May 25, 2024
1 parent daf0cc0 commit 32574ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/libvarnishapi/vsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ VSM_Status(struct vsm *vd)
int
VSM_Attach(struct vsm *vd, int progress)
{
const char *def;
double t0;
unsigned u;
int i, n = 0;
Expand All @@ -754,12 +755,11 @@ 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', "");
def = getenv("VARNISH_DEFAULT_N");
if (def == NULL)
def = ""; /* Use default (hostname) */
i = VSM_Arg(vd, 'n', def);
if (i < 0)
return (i);
AN(vd->wdname);
Expand Down

0 comments on commit 32574ab

Please sign in to comment.