From 53a1cf17cbd09b86ce75ef67f930ecb957e56060 Mon Sep 17 00:00:00 2001 From: phk Date: Fri, 21 Nov 2008 12:53:34 +0000 Subject: [PATCH] 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 --- varnish-cache/lib/libvarnish/subproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 { -- 2.39.5