summaryrefslogtreecommitdiff
path: root/Xi/opendev.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xi/opendev.c')
-rw-r--r--Xi/opendev.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/Xi/opendev.c b/Xi/opendev.c
index 0b0671d49..dfefe055c 100644
--- a/Xi/opendev.c
+++ b/Xi/opendev.c
@@ -56,14 +56,11 @@ 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 "XIstubs.h"
#include "windowstr.h" /* window structure */
-#include "extnsionst.h"
#include "extinit.h" /* LookupDeviceIntRec */
#include "exglobals.h"
@@ -107,26 +104,20 @@ ProcXOpenDevice(ClientPtr client)
REQUEST_SIZE_MATCH(xOpenDeviceReq);
if (stuff->deviceid == inputInfo.pointer->id ||
- stuff->deviceid == inputInfo.keyboard->id) {
- SendErrorToClient(client, IReqCode, X_OpenDevice, 0, BadDevice);
- return Success;
- }
+ stuff->deviceid == inputInfo.keyboard->id)
+ return BadDevice;
if ((dev = LookupDeviceIntRec(stuff->deviceid)) == NULL) { /* not open */
for (dev = inputInfo.off_devices; dev; dev = dev->next)
if (dev->id == stuff->deviceid)
break;
- if (dev == NULL) {
- SendErrorToClient(client, IReqCode, X_OpenDevice, 0, BadDevice);
- return Success;
- }
+ if (dev == NULL)
+ return BadDevice;
}
OpenInputDevice(dev, client, &status);
- if (status != Success) {
- SendErrorToClient(client, IReqCode, X_OpenDevice, 0, status);
- return Success;
- }
+ if (status != Success)
+ return status;
rep.repType = X_Reply;
rep.RepType = X_OpenDevice;