]> err.no Git - varnish/commitdiff
Make it possible to supress all or no lines of output
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 21 Nov 2008 12:53:34 +0000 (12:53 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 21 Nov 2008 12:53:34 +0000 (12:53 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3416 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/lib/libvarnish/subproc.c

index e5dd7581ec8646bf4e774877daef6d657bcc6c05..441f08c3b0bf79feaae6b6e8adbef10d678c391a 100644 (file)
@@ -59,7 +59,7 @@ sub_vlu(void *priv, const char *str)
        sp = priv;
        if (!sp->lines++)
                vsb_printf(sp->sb, "Message from %s:\n", sp->name);
-       if (sp->maxlines > 0 && sp->lines <= sp->maxlines)
+       if (sp->maxlines < 0 || sp->lines <= sp->maxlines)
                vsb_printf(sp->sb, "%s\n", str);
        return (0);
 }
@@ -108,7 +108,7 @@ SUB_run(struct vsb *sb, sub_func_f *func, void *priv, const char *name, int maxl
                continue;
        AZ(close(p[0]));
        VLU_Destroy(vlu);
-       if (sp.lines > sp.maxlines)
+       if (sp.maxlines >= 0 && sp.lines > sp.maxlines)
                vsb_printf(sb, "[%d lines truncated]\n",
                    sp.lines - sp.maxlines);
        do {