[PATCH 2/5] Honor return value from vmod init functions

Martin Blix Grydeland martin at varnish-software.com
Wed Jun 10 11:05:59 CEST 2015


Make use of the integer return value from vmod init functions, and
abort the vcl init on non-zero return.
---
 lib/libvcc/vcc_vmod.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/libvcc/vcc_vmod.c b/lib/libvcc/vcc_vmod.c
index 8391c98..be36a44 100644
--- a/lib/libvcc/vcc_vmod.c
+++ b/lib/libvcc/vcc_vmod.c
@@ -199,8 +199,9 @@ vcc_ParseImport(struct vcc *tl)
 			if (ifp == NULL)
 				ifp = New_IniFin(tl);
 			VSB_printf(ifp->ini,
-			    "\t%s(&vmod_priv_%.*s, &VCL_conf);",
+			    "\tif (%s(&vmod_priv_%.*s, &VCL_conf))\n",
 			    p, PF(mod));
+			VSB_printf(ifp->ini, "\t\treturn (1);");
 		} else {
 			sym = VCC_AddSymbolStr(tl, p, SYM_FUNC);
 			ERRCHK(tl);
-- 
2.1.4




More information about the varnish-dev mailing list