Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/lib/libc/rpc Pull up revisions 1.17-1.18 (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/ab2a94b5e69a
branches:  netbsd-1-6
changeset: 529869:ab2a94b5e69a
user:      jmc <jmc%NetBSD.org@localhost>
date:      Mon Jan 06 04:45:17 2003 +0000

description:
Pull up revisions 1.17-1.18 (requested by fvdl in ticket #1037)
 * Adapt include files for rpc_com.h/rpc_internal.h split.
 * Implement non-blocking connections.
 * Add rpc_control to svc.c

diffstat:

 lib/libc/rpc/svc_run.c |  16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (59 lines):

diff -r 62c0a7955cbc -r ab2a94b5e69a lib/libc/rpc/svc_run.c
--- a/lib/libc/rpc/svc_run.c    Mon Jan 06 04:45:00 2003 +0000
+++ b/lib/libc/rpc/svc_run.c    Mon Jan 06 04:45:17 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: svc_run.c,v 1.17 2000/07/06 03:10:35 christos Exp $    */
+/*     $NetBSD: svc_run.c,v 1.17.4.1 2003/01/06 04:45:17 jmc Exp $     */
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -35,7 +35,7 @@
 static char *sccsid = "@(#)svc_run.c 1.1 87/10/13 Copyr 1984 Sun Micro";
 static char *sccsid = "@(#)svc_run.c   2.1 88/07/29 4.0 RPCSRC";
 #else
-__RCSID("$NetBSD: svc_run.c,v 1.17 2000/07/06 03:10:35 christos Exp $");
+__RCSID("$NetBSD: svc_run.c,v 1.17.4.1 2003/01/06 04:45:17 jmc Exp $");
 #endif
 #endif
 
@@ -53,6 +53,8 @@
 
 #include <rpc/rpc.h>
 
+#include "rpc_internal.h"
+
 #ifdef __weak_alias
 __weak_alias(svc_run,_svc_run)
 __weak_alias(svc_exit,_svc_exit)
@@ -61,16 +63,21 @@
 void
 svc_run()
 {
-       fd_set readfds;
+       fd_set readfds, cleanfds;
+       struct timeval timeout;
 #ifdef __REENT
        extern rwlock_t svc_fd_lock;
 #endif
 
+       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:
                        if (errno == EINTR) {
                                continue;
@@ -78,6 +85,7 @@
                        warn("svc_run: - select failed");
                        return;
                case 0:
+                       __svc_clean_idle(&cleanfds, 30, FALSE);
                        continue;
                default:
                        svc_getreqset(&readfds);



Home | Main Index | Thread Index | Old Index