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:
Enrico Weigelt, metux IT consult
2025-09-02 20:06:36 +02:00
committed by Enrico Weigelt
parent d734b75a37
commit a7811ea424
3 changed files with 21 additions and 14 deletions

View File

@@ -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