aboutsummaryrefslogtreecommitdiff
path: root/sunrpc/svc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /sunrpc/svc.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.tar
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.bz2
glibc-a334319f6530564d22e775935d9c91663623a1b4.zip
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'sunrpc/svc.c')
-rw-r--r--sunrpc/svc.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sunrpc/svc.c b/sunrpc/svc.c
index 1e358e247c..6caf8412d5 100644
--- a/sunrpc/svc.c
+++ b/sunrpc/svc.c
@@ -372,7 +372,7 @@ svc_getreqset (fd_set *readfds)
setsize = FD_SETSIZE;
maskp = readfds->fds_bits;
for (sock = 0; sock < setsize; sock += NFDBITS)
- for (mask = *maskp++; (bit = ffsl (mask)); mask ^= (1L << (bit - 1)))
+ for (mask = *maskp++; (bit = ffs (mask)); mask ^= (1 << (bit - 1)))
INTUSE(svc_getreq_common) (sock + bit - 1);
}
INTDEF (svc_getreqset)
@@ -380,24 +380,22 @@ INTDEF (svc_getreqset)
void
svc_getreq_poll (struct pollfd *pfdp, int pollretval)
{
- if (pollretval == 0)
- return;
-
+ register int i;
register int fds_found;
- for (int i = fds_found = 0; i < svc_max_pollfd; ++i)
+
+ for (i = fds_found = 0; i < svc_max_pollfd && fds_found < pollretval; ++i)
{
register struct pollfd *p = &pfdp[i];
if (p->fd != -1 && p->revents)
{
/* fd has input waiting */
+ ++fds_found;
+
if (p->revents & POLLNVAL)
xprt_unregister (xports[p->fd]);
else
INTUSE(svc_getreq_common) (p->fd);
-
- if (++fds_found >= pollretval)
- break;
}
}
}