mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-09 02:40:08 +00:00
(svc_getreq_poll): Fix inefficient loop test.
This commit is contained in:
parent
77c4d1156f
commit
30199a6623
12
sunrpc/svc.c
12
sunrpc/svc.c
@ -380,22 +380,24 @@ INTDEF (svc_getreqset)
|
|||||||
void
|
void
|
||||||
svc_getreq_poll (struct pollfd *pfdp, int pollretval)
|
svc_getreq_poll (struct pollfd *pfdp, int pollretval)
|
||||||
{
|
{
|
||||||
register int i;
|
if (pollretval == 0)
|
||||||
register int fds_found;
|
return;
|
||||||
|
|
||||||
for (i = fds_found = 0; i < svc_max_pollfd && fds_found < pollretval; ++i)
|
register int fds_found;
|
||||||
|
for (int i = fds_found = 0; i < svc_max_pollfd; ++i)
|
||||||
{
|
{
|
||||||
register struct pollfd *p = &pfdp[i];
|
register struct pollfd *p = &pfdp[i];
|
||||||
|
|
||||||
if (p->fd != -1 && p->revents)
|
if (p->fd != -1 && p->revents)
|
||||||
{
|
{
|
||||||
/* fd has input waiting */
|
/* fd has input waiting */
|
||||||
++fds_found;
|
|
||||||
|
|
||||||
if (p->revents & POLLNVAL)
|
if (p->revents & POLLNVAL)
|
||||||
xprt_unregister (xports[p->fd]);
|
xprt_unregister (xports[p->fd]);
|
||||||
else
|
else
|
||||||
INTUSE(svc_getreq_common) (p->fd);
|
INTUSE(svc_getreq_common) (p->fd);
|
||||||
|
|
||||||
|
if (++fds_found >= pollretval)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user