dix: ProcListHosts(): use x_rpcbuf_t
Some checks are pending
Build X servers / xserver-build-ubuntu (push) Waiting to run
Build X servers / drivers-build-ubuntu (push) Waiting to run
Build X servers / xserver-build-mingw32-ubuntu (push) Waiting to run
Build X servers / xserver-build-macos (push) Waiting to run
Build X servers / xserver-build-freebsd (push) Waiting to run
Build X servers / Release pushed tag (push) Blocked by required conditions
check PRs for merge conflicts / notify (push) Waiting to run

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 19:32:02 +02:00 • committed by Enrico Weigelt
commit 8cfcb072d2

View file

@ -3288,13 +3288,12 @@ ProcListHosts(ClientPtr client)
return result;
xListHostsReply rep = {
.type = X_Reply,
.enabled = enabled,
.sequenceNumber = client->sequence,
.length = bytes_to_int32(len),
.nHosts = nHosts
};
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
if (client->swapped) {
char *bufT = pdata;
char *endbuf = bufT + len;
@ -3306,16 +3305,13 @@ ProcListHosts(ClientPtr client)
bufT += sizeof(xHostEntry) + pad_to_int32(l1);
}
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.nHosts);
}
WriteToClient(client, sizeof(rep), &rep);
WriteToClient(client, len, pdata);
x_rpcbuf_write_CARD8s(&rpcbuf, pdata, len);
free(pdata);
return Success;
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
}
int