From: Jon Trulson Date: Tue, 25 Mar 2014 01:37:09 +0000 (-0600) Subject: xtclient.c, spcd_event.c: stop referencing fds_bits directly X-Git-Tag: 2.2.2~26 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3c35e2d14d03e57c7b57918e1142f61c5375a9ba;p=oweals%2Fcde.git xtclient.c, spcd_event.c: stop referencing fds_bits directly --- diff --git a/cde/lib/csa/xtclient.c b/cde/lib/csa/xtclient.c index aff5b03a..9e58bc0f 100644 --- a/cde/lib/csa/xtclient.c +++ b/cde/lib/csa/xtclient.c @@ -59,8 +59,7 @@ extern void _DtCm_register_xtcallback(XtAppContext appct) { XtInputId id; - int i, j; - fd_mask fmask, *bits; + int i; fd_set fdset = svc_fdset; DP(("xtclient.c: _DtCm_register_xtcallback()\n")); @@ -69,29 +68,21 @@ _DtCm_register_xtcallback(XtAppContext appct) return; /* assuming only 1 bit is set */ - bits = fdset.fds_bits; - - for (i = 0; i < FD_SETSIZE; i += NFDBITS) { - fmask = *bits; - for (j = 0; fmask != 0; j++, fmask >>= 1) { - if (fmask & 0x1) { - - if ((i + j) >= FD_SETSIZE) - break; - - /* register callback with XtAppAddInput - * for rpc input - */ - id = XtAppAddInput(appct, ((i *NFDBITS) + j), - (XtPointer)XtInputReadMask, - xtcallback, NULL); - - DP(("xtclient.c: id %d for input at fd %d\n", - id, ((i * NFDBITS) + j))); - } - } - bits++; - } + + for (i = 0; i < FD_SETSIZE; i++) { + if (FD_ISSET(i, &svc_fdset)) + { + /* register callback with XtAppAddInput + * for rpc input + */ + id = XtAppAddInput(appct, i, + (XtPointer)XtInputReadMask, + xtcallback, NULL); + + DP(("xtclient.c: id %d for input at fd %d\n", + id, ((i * NFDBITS) + j))); + } + } } /***************************************************************************** diff --git a/cde/programs/dtspcd/spcd_event.c b/cde/programs/dtspcd/spcd_event.c index 01fdf28b..a79d19f2 100644 --- a/cde/programs/dtspcd/spcd_event.c +++ b/cde/programs/dtspcd/spcd_event.c @@ -84,11 +84,11 @@ void SPCD_MainLoopUntil(Boolean *flag) fd_set input_mask, except_mask; int n, fd; int result; + do { - for (n=0; n