mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
xfree86: dri: ProcXF86DRIGetClientDriverName() 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
e474b81a45
commit
2cb5aac7a3
@@ -203,11 +203,6 @@ ProcXF86DRICloseConnection(register ClientPtr client)
|
||||
static int
|
||||
ProcXF86DRIGetClientDriverName(register ClientPtr client)
|
||||
{
|
||||
xXF86DRIGetClientDriverNameReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.clientDriverNameLength = 0
|
||||
};
|
||||
char *clientDriverName;
|
||||
|
||||
REQUEST(xXF86DRIGetClientDriverNameReq);
|
||||
@@ -217,21 +212,21 @@ ProcXF86DRIGetClientDriverName(register ClientPtr client)
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
xXF86DRIGetClientDriverNameReply rep = { 0 };
|
||||
|
||||
DRIGetClientDriverName(screenInfo.screens[stuff->screen],
|
||||
(int *) &rep.ddxDriverMajorVersion,
|
||||
(int *) &rep.ddxDriverMinorVersion,
|
||||
(int *) &rep.ddxDriverPatchVersion,
|
||||
&clientDriverName);
|
||||
|
||||
if (clientDriverName)
|
||||
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
|
||||
if (clientDriverName) {
|
||||
rep.clientDriverNameLength = strlen(clientDriverName);
|
||||
rep.length = X_REPLY_HEADER_UNITS(xXF86DRIGetClientDriverNameReply)
|
||||
+ bytes_to_int32(rep.clientDriverNameLength);
|
||||
x_rpcbuf_write_CARD8s(&rpcbuf, (CARD8*)clientDriverName, rep.clientDriverNameLength);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(xXF86DRIGetClientDriverNameReply), &rep);
|
||||
if (rep.clientDriverNameLength)
|
||||
WriteToClient(client, rep.clientDriverNameLength, clientDriverName);
|
||||
return Success;
|
||||
return X_SEND_REPLY_WITH_RPCBUF(client, rep, rpcbuf);
|
||||
}
|
||||
|
||||
static int
|
||||
|
||||
Reference in New Issue
Block a user