summaryrefslogtreecommitdiff
path: root/Xi/getbmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xi/getbmap.c')
-rw-r--r--Xi/getbmap.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/Xi/getbmap.c b/Xi/getbmap.c
index 5e8cf07fb..ebb0613af 100644
--- a/Xi/getbmap.c
+++ b/Xi/getbmap.c
@@ -56,12 +56,9 @@ SOFTWARE.
#include <dix-config.h>
#endif
-#include <X11/X.h> /* for inputstr.h */
-#include <X11/Xproto.h> /* Request macro */
#include "inputstr.h" /* DeviceIntPtr */
#include <X11/extensions/XI.h>
#include <X11/extensions/XIproto.h>
-#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
@@ -106,18 +103,13 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
rep.sequenceNumber = client->sequence;
dev = LookupDeviceIntRec(stuff->deviceid);
- if (dev == NULL) {
- SendErrorToClient(client, IReqCode, X_GetDeviceButtonMapping, 0,
- BadDevice);
- return Success;
- }
+ if (dev == NULL)
+ return BadDevice;
b = dev->button;
- if (b == NULL) {
- SendErrorToClient(client, IReqCode, X_GetDeviceButtonMapping, 0,
- BadMatch);
- return Success;
- }
+ if (b == NULL)
+ return BadMatch;
+
rep.nElts = b->numButtons;
rep.length = (rep.nElts + (4 - 1)) / 4;
WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);