_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"));
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)));
+ }
+ }
}
/*****************************************************************************
fd_set input_mask, except_mask;
int n, fd;
int result;
+
do {
- for (n=0; n<fd_vec_size; n++) {
- input_mask.fds_bits[n] = Sb_Input_Mask.fds_bits[n];
- except_mask.fds_bits[n] = Sb_Except_Mask.fds_bits[n];
- }
+ memcpy(&input_mask, &Sb_Input_Mask, sizeof(fd_set));
+ memcpy(&except_mask, &Sb_Except_Mask, sizeof(fd_set));
+
do result=select(SPCD_max_fd + 1, FD_SET_CAST(&input_mask),
FD_SET_CAST(NULL),