mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
dix: let X_SEND_REPLY_WITH_RPCBUF() return status code
Check for rpcbuf error and return BadAlloc then, otherwise return Success. This way, callers don't need to check their rpcbuf for error on their own anymore, but can just do return X_SEND_REPLY_WITH_RPCBUF(...). Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -748,9 +748,12 @@ static inline Atom dixGetAtomID(const char *name) {
|
||||
#define X_REPLY_HEADER_UNITS(hdrtype) \
|
||||
(pad_to_int32((sizeof(hdrtype) - sizeof(xGenericReply))))
|
||||
|
||||
static inline void __write_reply_hdr_and_rpcbuf(
|
||||
static inline int __write_reply_hdr_and_rpcbuf(
|
||||
ClientPtr pClient, void *hdrData, size_t hdrLen, x_rpcbuf_t *rpcbuf)
|
||||
{
|
||||
if (rpcbuf->error)
|
||||
return BadAlloc;
|
||||
|
||||
xGenericReply *reply = hdrData;
|
||||
reply->type = X_Reply;
|
||||
reply->length = (bytes_to_int32(hdrLen - sizeof(xGenericReply)))
|
||||
@@ -764,6 +767,8 @@ static inline void __write_reply_hdr_and_rpcbuf(
|
||||
|
||||
WriteToClient(pClient, hdrLen, hdrData);
|
||||
WriteRpcbufToClient(pClient, rpcbuf);
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
static inline void __write_reply_hdr_simple(
|
||||
|
||||
Reference in New Issue
Block a user