From e18aafa194afdb6f62b37f516cfd4ef1ddc866af Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Sun, 8 Jul 2001 12:24:10 +0000 Subject: [PATCH] * svc.c (xprt_register): If svc_fdset has not been initilized, FD_ZERO it. * rpc_commondata.c: Do not assume what the structure of an fd_set looks like. Add variable gssrpc_svc_fdset_init to determine if initialized. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13585 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/rpc/ChangeLog | 9 +++++++++ src/lib/rpc/rpc_commondata.c | 3 ++- src/lib/rpc/svc.c | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/lib/rpc/ChangeLog b/src/lib/rpc/ChangeLog index 1040d7586..910ee4a50 100644 --- a/src/lib/rpc/ChangeLog +++ b/src/lib/rpc/ChangeLog @@ -1,3 +1,12 @@ +2001-07-08 Ezra Peisach + + * svc.c (xprt_register): If svc_fdset has not been initilized, + FD_ZERO it. + + * rpc_commondata.c: Do not assume what the structure of an fd_set + looks like. Add variable gssrpc_svc_fdset_init to determine if + initialized. + 2001-07-06 Ezra Peisach * auth_unix.c: In case GETGROUPS_T is not defined, default to int. diff --git a/src/lib/rpc/rpc_commondata.c b/src/lib/rpc/rpc_commondata.c index 8c27774e2..530b181e8 100644 --- a/src/lib/rpc/rpc_commondata.c +++ b/src/lib/rpc/rpc_commondata.c @@ -37,7 +37,8 @@ */ struct opaque_auth _null_auth = {0}; #ifdef FD_SETSIZE -fd_set svc_fdset = {0}; +fd_set svc_fdset; /* Will be zeroed in data segment */ +int gssrpc_svc_fdset_init = 0; #else int svc_fds = 0; #endif /* def FD_SETSIZE */ diff --git a/src/lib/rpc/svc.c b/src/lib/rpc/svc.c index 573ea887c..5c82b44b7 100644 --- a/src/lib/rpc/svc.c +++ b/src/lib/rpc/svc.c @@ -51,6 +51,7 @@ extern int errno; #ifdef FD_SETSIZE static SVCXPRT **xports; static int max_xport = 0; +extern int gssrpc_svc_fdset_init; #else #define NOFILE 32 @@ -88,6 +89,10 @@ xprt_register(xprt) register int sock = xprt->xp_sock; #ifdef FD_SETSIZE + if (gssrpc_svc_fdset_init == 0) { + FD_ZERO(&svc_fdset); + gssrpc_svc_fdset_init++; + } if (xports == NULL) { xports = (SVCXPRT **) mem_alloc(FD_SETSIZE * sizeof(SVCXPRT *)); -- 2.26.2