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


_______________________________________________
varnish-dev mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev

Reply via email to