Commit 469d65e0 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

VSM_Delete() -> VSM_Destroy() to follow our current OO schema.

parent a0b34bd4
......@@ -402,18 +402,18 @@ n_arg_sock(const char *n_arg)
AN(vsm);
if (VSM_n_Arg(vsm, n_arg) < 0) {
fprintf(stderr, "%s\n", VSM_Error(vsm));
VSM_Delete(vsm);
VSM_Destroy(&vsm);
return (-1);
}
if (VSM_Open(vsm)) {
fprintf(stderr, "%s\n", VSM_Error(vsm));
VSM_Delete(vsm);
VSM_Destroy(&vsm);
return (-1);
}
if (!VSM_Get(vsm, &vt, "Arg", "-T")) {
fprintf(stderr, "No -T arg in shared memory\n");
VSM_Delete(vsm);
VSM_Destroy(&vsm);
return (-1);
}
AZ(VSM_Map(vsm, &vt));
......@@ -426,7 +426,7 @@ n_arg_sock(const char *n_arg)
S_arg = strdup(vt.b);
}
VSM_Delete(vsm);
VSM_Destroy(&vsm);
sock = -1;
while (*T_arg) {
......
......@@ -192,7 +192,7 @@ logexp_delete(struct logexp *le)
logexp_delete_tests(le);
free(le->name);
free(le->query);
VSM_Delete(le->vsm);
VSM_Destroy(&le->vsm);
if (le->n_arg)
VSB_destroy(&le->n_arg);
FREE_OBJ(le);
......
......@@ -276,7 +276,7 @@ varnishlog_thread(void *priv)
if (c)
VSL_DeleteCursor(c);
VSL_Delete(vsl);
VSM_Delete(vsm);
VSM_Destroy(&vsm);
return (NULL);
}
......@@ -335,7 +335,7 @@ varnish_delete(struct varnish *v)
free(v->name);
free(v->workdir);
if (v->vd != NULL)
VSM_Delete(v->vd);
VSM_Destroy(&v->vd);
/*
* We do not delete the workdir, it may contain stuff people
......
......@@ -70,7 +70,7 @@ struct vsm *VSM_New(void);
* NULL: malloc failed.
*/
void VSM_Delete(struct vsm *vd);
void VSM_Destroy(struct vsm **vd);
/*
* Close and deallocate all storage and mappings.
* (including any VSC and VSL "sub-classes")
......
......@@ -182,6 +182,7 @@ LIBVARNISHAPI_1.7 {
VSM_invalid;
VSM_valid;
VSM_similar;
VSM_Destroy;
VSM_Map;
VSM_Unmap;
VSC_Destroy_Point;
......
......@@ -216,8 +216,13 @@ VSM_Name(const struct vsm *vd)
/*--------------------------------------------------------------------*/
void
VSM_Delete(struct vsm *vd)
VSM_Destroy(struct vsm **vdp)
{
struct vsm *vd;
AN(vdp);
vd = *vdp;
*vdp = NULL;
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
......
......@@ -336,7 +336,7 @@ VUT_Fini(void)
if (VUT.vsl)
VSL_Delete(VUT.vsl);
if (VUT.vsm)
VSM_Delete(VUT.vsm);
VSM_Destroy(&VUT.vsm);
memset(&VUT, 0, sizeof 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