Commit b0b4a338 authored by Dag Erling Smørgrav's avatar Dag Erling Smørgrav

Slightly more elegant version of the previous commit, which also fixed a

tiny braino.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2593 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 1b2c3491
......@@ -56,8 +56,8 @@ static VTAILQ_HEAD(,sess) sesshead = VTAILQ_HEAD_INITIALIZER(sesshead);
static void
vca_pollspace(unsigned fd)
{
struct pollfd *newpollfd;
unsigned newnpoll;
struct pollfd *newpollfd = pollfd;
unsigned newnpoll = npoll;
if (fd < npoll)
return;
......@@ -65,10 +65,10 @@ vca_pollspace(unsigned fd)
while (fd >= newnpoll)
newnpoll = newnpoll * 2 + 1;
VSL(SLT_Debug, 0, "Acceptor poll space increased to %u", newnpoll);
newpollfd = realloc(pollfd, newnpoll * sizeof *pollfd);
newpollfd = realloc(newpollfd, newnpoll * sizeof *newpollfd);
XXXAN(newpollfd); /* close offending fd */
memset(newpollfd + npoll, 0, (newnpoll - npoll) * sizeof *newpollfd);
pollfd = newpollfd;
memset(pollfd + npoll, 0, (newnpoll - npoll) * sizeof *pollfd);
while (npoll < newnpoll)
pollfd[npoll++].fd = -1;
}
......
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