rpcbind/099-poll.patch
Ismail Dönmez 91ff6aa42e Accepting request 345010 from home:kukuk:NSL
- Add 0002-revert-auth.patch: revert old patch no longer working
  with libtirpc 1.0.1 
  (http://sourceforge.net/p/libtirpc/mailman/message/34585439/)

- Add 099-poll.patch: use libtirpc with poll() implementation

OBS-URL: https://build.opensuse.org/request/show/345010
OBS-URL: https://build.opensuse.org/package/show/network/rpcbind?expand=0&rev=56
2015-11-18 11:15:36 +00:00

77 lines
1.8 KiB
Diff

diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
index ff9ce6b..d675eda 100644
--- a/src/rpcb_svc_com.c
+++ b/src/rpcb_svc_com.c
@@ -1097,35 +1097,28 @@ netbuffree(struct netbuf *ap)
}
-#define MASKVAL (POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND)
-extern bool_t __svc_clean_idle(fd_set *, int, bool_t);
-
void
my_svc_run()
{
- size_t nfds;
- struct pollfd pollfds[FD_SETSIZE];
int poll_ret, check_ret;
int n;
-#ifdef SVC_RUN_DEBUG
- int i;
-#endif
- register struct pollfd *p;
- fd_set cleanfds;
for (;;) {
- p = pollfds;
- for (n = 0; n <= svc_maxfd; n++) {
- if (FD_ISSET(n, &svc_fdset)) {
- p->fd = n;
- p->events = MASKVAL;
- p++;
- }
- }
- nfds = p - pollfds;
- poll_ret = 0;
+ struct pollfd my_pollfd[svc_max_pollfd];
+ int i;
+
+ if (svc_max_pollfd == 0 && svc_pollfd == NULL)
+ return;
- switch (poll_ret = poll(pollfds, nfds, 30 * 1000)) {
+
+ for (i = 0; i < svc_max_pollfd; ++i)
+ {
+ my_pollfd[i].fd = svc_pollfd[i].fd;
+ my_pollfd[i].events = svc_pollfd[i].events;
+ my_pollfd[i].revents = 0;
+ }
+
+ switch (poll_ret = poll(my_pollfd, svc_max_pollfd, 30 * 1000)) {
case -1:
/*
* We ignore all errors, continuing with the assumption
@@ -1133,8 +1126,6 @@ my_svc_run()
* other outside event) and not caused by poll().
*/
case 0:
- cleanfds = svc_fdset;
- __svc_clean_idle(&cleanfds, 30, FALSE);
continue;
default:
/*
@@ -1144,10 +1135,10 @@ my_svc_run()
* don't call svc_getreq_poll. Otherwise, there
* must be another so we must call svc_getreq_poll.
*/
- if ((check_ret = check_rmtcalls(pollfds, nfds)) ==
+ if ((check_ret = check_rmtcalls(my_pollfd, svc_max_pollfd)) ==
poll_ret)
continue;
- svc_getreq_poll(pollfds, poll_ret-check_ret);
+ svc_getreq_poll(my_pollfd, poll_ret-check_ret);
}
}
}