aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/svc_run.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/rpc/svc_run.c')
-rw-r--r--lib/libc/rpc/svc_run.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libc/rpc/svc_run.c b/lib/libc/rpc/svc_run.c
index 6d13ee01bc68..53d73f3eb1ad 100644
--- a/lib/libc/rpc/svc_run.c
+++ b/lib/libc/rpc/svc_run.c
@@ -55,14 +55,19 @@ __FBSDID("$FreeBSD$");
void
svc_run()
{
- fd_set readfds;
+ fd_set readfds, cleanfds;
+ struct timeval timeout;
extern rwlock_t svc_fd_lock;
+ timeout.tv_sec = 30;
+ timeout.tv_usec = 0;
+
for (;;) {
rwlock_rdlock(&svc_fd_lock);
readfds = svc_fdset;
+ cleanfds = svc_fdset;
rwlock_unlock(&svc_fd_lock);
- switch (_select(svc_maxfd+1, &readfds, NULL, NULL, NULL)) {
+ switch (select(svc_maxfd+1, &readfds, NULL, NULL, &timeout)) {
case -1:
FD_ZERO(&readfds);
if (errno == EINTR) {
@@ -71,6 +76,7 @@ svc_run()
_warn("svc_run: - select failed");
return;
case 0:
+ __svc_clean_idle(&cleanfds, 30, FALSE);
continue;
default:
svc_getreqset(&readfds);