diff --git a/dix/dispatch.c b/dix/dispatch.c index 4bb6b6f03..5f6037a94 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1090,18 +1090,22 @@ ProcInternAtom(ClientPtr client) } tchar = (char *) &stuff[1]; atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists); - if (atom != BAD_RESOURCE) { - xInternAtomReply reply = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .atom = atom - }; - WriteReplyToClient(client, sizeof(xInternAtomReply), &reply); - return Success; - } - else + if (atom == BAD_RESOURCE) return BadAlloc; + + xInternAtomReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .atom = atom + }; + + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.atom); + } + WriteToClient(client, sizeof(rep), &rep); + return Success; } int diff --git a/dix/swaprep.c b/dix/swaprep.c index 3f3a389b7..1657c1749 100644 --- a/dix/swaprep.c +++ b/dix/swaprep.c @@ -183,14 +183,6 @@ SGenericReply(ClientPtr pClient, int size, xGenericReply * pRep) WriteToClient(pClient, size, pRep); } -void _X_COLD -SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply * pRep) -{ - swaps(&pRep->sequenceNumber); - swapl(&pRep->atom); - WriteToClient(pClient, size, pRep); -} - void _X_COLD SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply * pRep) { diff --git a/dix/tables.c b/dix/tables.c index 69c2d0d66..56b9fdb8e 100644 --- a/dix/tables.c +++ b/dix/tables.c @@ -731,7 +731,7 @@ ReplySwapPtr ReplySwapVector[256] = { ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, /* 15 */ - (ReplySwapPtr) SInternAtomReply, + ReplyNotSwappd, (ReplySwapPtr) SGetAtomNameReply, ReplyNotSwappd, ReplyNotSwappd, diff --git a/include/swaprep.h b/include/swaprep.h index 80d243c00..ca7e3d9e8 100644 --- a/include/swaprep.h +++ b/include/swaprep.h @@ -42,10 +42,6 @@ extern void SGenericReply(ClientPtr /* pClient */ , int /* size */ , xGenericReply * /* pRep */ ); -extern void SInternAtomReply(ClientPtr /* pClient */ , - int /* size */ , - xInternAtomReply * /* pRep */ ); - extern void SGetAtomNameReply(ClientPtr /* pClient */ , int /* size */ , xGetAtomNameReply * /* pRep */ );