mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
dix: ProcGetAtomName(): use x_rpcbuf_t
Use x_rpcbuf_t for reply 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
40473404e4
commit
59e74c0a1b
@@ -1092,21 +1092,19 @@ ProcGetAtomName(ClientPtr client)
|
||||
}
|
||||
|
||||
const int len = strlen(str);
|
||||
|
||||
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
|
||||
x_rpcbuf_write_CARD8s(&rpcbuf, (CARD8*)str, len);
|
||||
|
||||
xGetAtomNameReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = bytes_to_int32(len),
|
||||
.nameLength = len
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swaps(&rep.nameLength);
|
||||
}
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
WriteToClient(client, len, str);
|
||||
return Success;
|
||||
|
||||
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
Reference in New Issue
Block a user