aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs')
-rw-r--r--nx-X11/programs/Xserver/dix/dispatch.c6
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c42
2 files changed, 13 insertions, 35 deletions
diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c
index ef3d7b021..3ab9b2472 100644
--- a/nx-X11/programs/Xserver/dix/dispatch.c
+++ b/nx-X11/programs/Xserver/dix/dispatch.c
@@ -3648,9 +3648,12 @@ void InitClient(ClientPtr client, int i, void * ospriv)
client->clientIds = NULL;
}
-#ifndef NXAGENT_SERVER
int
+#ifdef NXAGENT_SERVER
+xorg_InitClientPrivates(ClientPtr client)
+#else
InitClientPrivates(ClientPtr client)
+#endif
{
register char *ptr;
DevUnion *ppriv;
@@ -3694,7 +3697,6 @@ InitClientPrivates(ClientPtr client)
}
return 1;
}
-#endif /* NXAGENT_SERVER */
/************************
* int NextAvailableClient(ospriv)
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
index c427c05f2..ace2941b1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
@@ -1115,41 +1115,17 @@ CloseDownClient(register ClientPtr client)
int
InitClientPrivates(ClientPtr client)
{
- register char *ptr;
- DevUnion *ppriv;
- register unsigned *sizes;
- register unsigned size;
- register int i;
-
- if (totalClientSize == sizeof(ClientRec))
- ppriv = (DevUnion *)NULL;
- else if (client->index)
- ppriv = (DevUnion *)(client + 1);
- else
- {
- ppriv = (DevUnion *)malloc(totalClientSize - sizeof(ClientRec));
- if (!ppriv)
- return 0;
- }
- client->devPrivates = ppriv;
- sizes = clientPrivateSizes;
- ptr = (char *)(ppriv + clientPrivateLen);
- for (i = clientPrivateLen; --i >= 0; ppriv++, sizes++)
+ int ret = xorg_InitClientPrivates(client);
+
+ if (ret == 1)
{
- if ( (size = *sizes) )
- {
- ppriv->ptr = (void *)ptr;
- ptr += size;
- }
- else
- ppriv->ptr = (void *)NULL;
- }
- /*
- * Initialize the private members.
- */
+ /*
+ * Initialize the private members.
+ */
- nxagentInitClientPrivates(client);
+ nxagentInitClientPrivates(client);
+ }
- return 1;
+ return ret;
}