From: phk Date: Fri, 21 Nov 2008 12:53:34 +0000 (+0000) Subject: Make it possible to supress all or no lines of output X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53a1cf17cbd09b86ce75ef67f930ecb957e56060;p=varnish Make it possible to supress all or no lines of output git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3416 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/lib/libvarnish/subproc.c b/varnish-cache/lib/libvarnish/subproc.c index e5dd7581..441f08c3 100644 --- a/varnish-cache/lib/libvarnish/subproc.c +++ b/varnish-cache/lib/libvarnish/subproc.c @@ -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 {