summaryrefslogtreecommitdiff
path: root/Xi/setmmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xi/setmmap.c')
-rw-r--r--Xi/setmmap.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/Xi/setmmap.c b/Xi/setmmap.c
index e30213e8a..19ec71bbe 100644
--- a/Xi/setmmap.c
+++ b/Xi/setmmap.c
@@ -56,13 +56,10 @@ 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 "exevents.h"
-#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
@@ -103,11 +100,8 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xSetDeviceModifierMappingReq);
dev = LookupDeviceIntRec(stuff->deviceid);
- if (dev == NULL) {
- SendErrorToClient(client, IReqCode, X_SetDeviceModifierMapping, 0,
- BadDevice);
- return Success;
- }
+ if (dev == NULL)
+ return BadDevice;
rep.repType = X_Reply;
rep.RepType = X_SetDeviceModifierMapping;
@@ -125,11 +119,8 @@ ProcXSetDeviceModifierMapping(ClientPtr client)
SendDeviceMappingNotify(client, MappingModifier, 0, 0, dev);
WriteReplyToClient(client, sizeof(xSetDeviceModifierMappingReply),
&rep);
- } else {
- if (ret == -1)
- ret = BadValue;
- SendErrorToClient(client, IReqCode, X_SetDeviceModifierMapping, 0, ret);
- }
+ } else if (ret == -1)
+ return BadValue;
return Success;
}