mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
dix: ProcGetFontPath(): use x_rpcbuf_t
Use x_rpcbuf_t for payload assembly and X_SEND_REPLY_WITH_RPCBUF() for sending it all out. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
d734b75a37
commit
a7811ea424
@@ -3396,31 +3396,24 @@ ProcSetFontPath(ClientPtr client)
|
||||
int
|
||||
ProcGetFontPath(ClientPtr client)
|
||||
{
|
||||
int rc, stringLens, numpaths;
|
||||
unsigned char *bufferStart;
|
||||
|
||||
/* REQUEST (xReq); */
|
||||
|
||||
REQUEST_SIZE_MATCH(xReq);
|
||||
rc = GetFontPath(client, &numpaths, &stringLens, &bufferStart);
|
||||
|
||||
int rc = XaceHookServerAccess(client, DixGetAttrAccess);
|
||||
if (rc != Success)
|
||||
return rc;
|
||||
|
||||
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
|
||||
|
||||
xGetFontPathReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = bytes_to_int32(stringLens + numpaths),
|
||||
.nPaths = numpaths
|
||||
.nPaths = FillFontPath(&rpcbuf)
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.nPaths);
|
||||
}
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
WriteToClient(client, stringLens + numpaths, bufferStart);
|
||||
return Success;
|
||||
|
||||
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user