From: phk Date: Sun, 6 Aug 2006 16:55:58 +0000 (+0000) Subject: Make X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3fbcfd2d83d7c2b7bc568621707264dffa4bcae;p=varnish Make -w - work as expected. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@701 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishlog/varnishlog.c b/varnish-cache/bin/varnishlog/varnishlog.c index 73834c39..31d19d53 100644 --- a/varnish-cache/bin/varnishlog/varnishlog.c +++ b/varnish-cache/bin/varnishlog/varnishlog.c @@ -232,7 +232,10 @@ main(int argc, char **argv) Usage(); if (w_opt != NULL) { - wfile = fopen(w_opt, "w"); + if (!strcmp(w_opt, "-")) + wfile = stdout; + else + wfile = fopen(w_opt, "w"); if (wfile == NULL) { perror(w_opt); exit (1); @@ -249,10 +252,10 @@ main(int argc, char **argv) if (w_opt == NULL) { if (o_flag && ++v == 100) clean_order(); - fflush(stdout); + fflush(stderr); } else if (++v == 100) { fflush(wfile); - printf("\nFlushed\n"); + fprintf(stderr, "\nFlushed\n"); } usleep(50000); continue; @@ -264,8 +267,8 @@ main(int argc, char **argv) perror(w_opt); u++; if (!(u % 1000)) { - printf("%u\r", u); - fflush(stdout); + fprintf(stderr, "%u\r", u); + fflush(stderr); } continue; }