From: des Date: Tue, 22 Aug 2006 09:37:58 +0000 (+0000) Subject: Correct the error check for write(). X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0cd2ed766614f8e23bae82b593970e64697c40c;p=varnish Correct the error check for write(). git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@892 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishlog/varnishlog.c b/varnish-cache/bin/varnishlog/varnishlog.c index b6cacba7..c290ed79 100644 --- a/varnish-cache/bin/varnishlog/varnishlog.c +++ b/varnish-cache/bin/varnishlog/varnishlog.c @@ -193,8 +193,10 @@ do_write(struct VSL_data *vd, const char *w_opt) break; if (i > 0) { i = write(fd, p, 5 + p[1]); - if (i != 1) + if (i < 0) { perror(w_opt); + exit(1); + } } } exit (0);