Commit 45e158ca authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

Partial merge of r2025: Assert return values of system{calls,functions}


git-svn-id: http://www.varnish-cache.org/svn/branches/1.1@2148 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 27ed5d22
......@@ -50,16 +50,16 @@ rdf(struct pollfd *fds, int idx)
i = read(fds[idx].fd, buf, sizeof buf);
if (i <= 0 || fds[1-idx].events == 0) {
shutdown(fds[idx].fd, SHUT_RD);
shutdown(fds[1-idx].fd, SHUT_WR);
AZ(shutdown(fds[idx].fd, SHUT_RD));
AZ(shutdown(fds[1-idx].fd, SHUT_WR));
fds[idx].events = 0;
return;
}
for (p = buf; i > 0; i -= j, p += j) {
j = write(fds[1-idx].fd, p, i);
if (j != i) {
shutdown(fds[idx].fd, SHUT_WR);
shutdown(fds[1-idx].fd, SHUT_RD);
AZ(shutdown(fds[idx].fd, SHUT_WR));
AZ(shutdown(fds[1-idx].fd, SHUT_RD));
fds[1-idx].events = 0;
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment