aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs')
-rw-r--r--nx-X11/programs/Xserver/os/WaitFor.c4
-rw-r--r--nx-X11/programs/Xserver/os/connection.c2
-rw-r--r--nx-X11/programs/Xserver/os/osdep.h2
3 files changed, 5 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c
index 3d53335b3..82462b926 100644
--- a/nx-X11/programs/Xserver/os/WaitFor.c
+++ b/nx-X11/programs/Xserver/os/WaitFor.c
@@ -106,6 +106,8 @@ static unsigned long startTimeInMillis;
Windows in the code */
#define GetErrno() errno
+/* like ffs, but uses fd_mask instead of int as argument, so it works
+ when fd_mask is longer than an int, such as common 64-bit platforms */
/* modifications by raphael */
int
mffs(fd_mask mask)
@@ -480,7 +482,7 @@ WaitForSomething(int *pClientsReady)
{
int client_index;
- curclient = ffs (clientsReadable.fds_bits[i]) - 1;
+ curclient = mffs (clientsReadable.fds_bits[i]) - 1;
client_index = /* raphael: modified */
ConnectionTranslation[curclient + (i * (sizeof(fd_mask) * 8))];
pClientsReady[nready++] = client_index;
diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c
index 8ebef9c33..4d30dd86f 100644
--- a/nx-X11/programs/Xserver/os/connection.c
+++ b/nx-X11/programs/Xserver/os/connection.c
@@ -908,7 +908,7 @@ CheckConnections(void)
mask = AllClients.fds_bits[i];
while (mask)
{
- curoff = ffs (mask) - 1;
+ curoff = mffs (mask) - 1;
curclient = curoff + (i * (sizeof(fd_mask)*8));
FD_ZERO(&tmask);
FD_SET(curclient, &tmask);
diff --git a/nx-X11/programs/Xserver/os/osdep.h b/nx-X11/programs/Xserver/os/osdep.h
index 5985cfef2..e106c5544 100644
--- a/nx-X11/programs/Xserver/os/osdep.h
+++ b/nx-X11/programs/Xserver/os/osdep.h
@@ -218,7 +218,7 @@ extern OsCommPtr AvailableInput;
extern WorkQueuePtr workQueue;
-/* added by raphael */
+/* in WaitFor.c */
#define ffs mffs
extern int mffs(fd_mask);