[5.2] 65cccda Polish

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Thu Sep 7 06:59:07 UTC 2017


commit 65cccdadc533c997c07a599878c14064c61a20cf
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Sep 5 11:39:44 2017 +0200

    Polish

diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index 3657376..313ed52 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -397,10 +397,7 @@ VGZ_Destroy(struct vgz **vgp)
 	enum vgzret_e vr;
 	int i;
 
-	vg = *vgp;
-	CHECK_OBJ_NOTNULL(vg, VGZ_MAGIC);
-	*vgp = NULL;
-
+	TAKE_OBJ_NOTNULL(vg, vgp, VGZ_MAGIC);
 	AN(vg->id);
 	VSLb(vg->vsl, SLT_Gzip, "%s %jd %jd %jd %jd %jd",
 	    vg->id,
diff --git a/lib/libvarnish/vcli_serve.c b/lib/libvarnish/vcli_serve.c
index e80d1b7..cb40ea9 100644
--- a/lib/libvarnish/vcli_serve.c
+++ b/lib/libvarnish/vcli_serve.c
@@ -607,9 +607,7 @@ VCLS_Destroy(struct VCLS **csp)
 	struct VCLS_fd *cfd, *cfd2;
 	struct cli_proto *clp;
 
-	cs = *csp;
-	*csp = NULL;
-	CHECK_OBJ_NOTNULL(cs, VCLS_MAGIC);
+	TAKE_OBJ_NOTNULL(cs, csp, VCLS_MAGIC);
 	VTAILQ_FOREACH_SAFE(cfd, &cs->fds, list, cfd2)
 		cls_close_fd(cs, cfd);
 
diff --git a/lib/libvarnish/vsmw.c b/lib/libvarnish/vsmw.c
index ee9fa3e..a5c7e3f 100644
--- a/lib/libvarnish/vsmw.c
+++ b/lib/libvarnish/vsmw.c
@@ -301,11 +301,7 @@ VSMW_Destroy(struct vsmw **pp)
 	struct vsmw *vsmw;
 	struct vsmwseg *seg, *s2;
 
-	AN(pp);
-	AN(*pp);
-	vsmw = *pp;
-	*pp = NULL;
-	CHECK_OBJ_NOTNULL(vsmw, VSMW_MAGIC);
+	TAKE_OBJ_NOTNULL(vsmw, pp, VSMW_MAGIC);
 	AZ(unlinkat(vsmw->vdirfd, vsmw->idx, 0));
 	REPLACE(vsmw->idx, NULL);
 	VTAILQ_FOREACH_SAFE(seg, &vsmw->segs, list, s2)
diff --git a/lib/libvarnishapi/vsm.c b/lib/libvarnishapi/vsm.c
index 235c9e0..bbdc8ab 100644
--- a/lib/libvarnishapi/vsm.c
+++ b/lib/libvarnishapi/vsm.c
@@ -237,11 +237,7 @@ VSM_Destroy(struct vsm **vdp)
 {
 	struct vsm *vd;
 
-	AN(vdp);
-	vd = *vdp;
-	*vdp = NULL;
-
-	CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
+	TAKE_OBJ_NOTNULL(vd, vdp, VSM_MAGIC);
 
 	if (vd->vsc != NULL)
 		VSC_Delete(vd->vsc);


More information about the varnish-commit mailing list