diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-04-24 08:55:46 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2006-04-24 08:55:46 +0000 |
commit | d0145e03799e484f3a53d79de3b3f34162ee9d3c (patch) | |
tree | d8c51a0952204f9015de0db3319d4c820e8646e0 /nscd/connections.c | |
parent | f5ce81c94cc27035f44d37bffa7f7e08dbce7631 (diff) | |
download | glibc-d0145e03799e484f3a53d79de3b3f34162ee9d3c.tar glibc-d0145e03799e484f3a53d79de3b3f34162ee9d3c.tar.gz glibc-d0145e03799e484f3a53d79de3b3f34162ee9d3c.tar.bz2 glibc-d0145e03799e484f3a53d79de3b3f34162ee9d3c.zip |
Updated to fedora-glibc-20060424T0820
Diffstat (limited to 'nscd/connections.c')
-rw-r--r-- | nscd/connections.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/nscd/connections.c b/nscd/connections.c index 1e3cd7557f..0426e6346f 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -1556,18 +1556,24 @@ main_loop_poll (void) /* We have a new incoming connection. Accept the connection. */ int fd = TEMP_FAILURE_RETRY (accept (sock, NULL, NULL)); - /* use the descriptor if we have not reached the limit. */ - if (fd >= 0 && firstfree < nconns) + /* Use the descriptor if we have not reached the limit. */ + if (fd >= 0) { - conns[firstfree].fd = fd; - conns[firstfree].events = POLLRDNORM; - starttime[firstfree] = now; - if (firstfree >= nused) - nused = firstfree + 1; - - do - ++firstfree; - while (firstfree < nused && conns[firstfree].fd != -1); + if (firstfree < nconns) + { + conns[firstfree].fd = fd; + conns[firstfree].events = POLLRDNORM; + starttime[firstfree] = now; + if (firstfree >= nused) + nused = firstfree + 1; + + do + ++firstfree; + while (firstfree < nused && conns[firstfree].fd != -1); + } + else + /* We cannot use the connection so close it. */ + close (fd); } --n; |