summaryrefslogtreecommitdiff
path: root/Xi/getdctl.c
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2007-09-24 13:33:01 -0400
committerEamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil>2007-09-26 07:26:59 -0400
commit31a7994ac7365562ef1d00e0a7b25f967a961a4e (patch)
treea2054c0e371e9c62396f2e09df469142dca0a633 /Xi/getdctl.c
parent56ffc381d32687242dd094395fcf2216339bab2a (diff)
Input: Return errors to the dispatcher instead of sending them ourself.
Also fixed two "unused variable: stuff" warnings.
Diffstat (limited to 'Xi/getdctl.c')
-rw-r--r--Xi/getdctl.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/Xi/getdctl.c b/Xi/getdctl.c
index 88f061ee0..8a84e91bc 100644
--- a/Xi/getdctl.c
+++ b/Xi/getdctl.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"
@@ -250,10 +247,8 @@ ProcXGetDeviceControl(ClientPtr client)
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
dev = LookupDeviceIntRec(stuff->deviceid);
- if (dev == NULL) {
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadDevice);
- return Success;
- }
+ if (dev == NULL)
+ return BadDevice;
rep.repType = X_Reply;
rep.RepType = X_GetDeviceControl;
@@ -262,29 +257,20 @@ ProcXGetDeviceControl(ClientPtr client)
switch (stuff->control) {
case DEVICE_RESOLUTION:
- if (!dev->valuator) {
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
- BadMatch);
- return Success;
- }
+ if (!dev->valuator)
+ return BadMatch;
total_length = sizeof(xDeviceResolutionState) +
(3 * sizeof(int) * dev->valuator->numAxes);
break;
case DEVICE_ABS_CALIB:
- if (!dev->absolute) {
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
- BadMatch);
- return Success;
- }
+ if (!dev->absolute)
+ return BadMatch;
total_length = sizeof(xDeviceAbsCalibCtl);
break;
case DEVICE_ABS_AREA:
- if (!dev->absolute) {
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0,
- BadMatch);
- return Success;
- }
+ if (!dev->absolute)
+ return BadMatch;
total_length = sizeof(xDeviceAbsAreaCtl);
break;
@@ -295,15 +281,12 @@ ProcXGetDeviceControl(ClientPtr client)
total_length = sizeof(xDeviceEnableCtl);
break;
default:
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadValue);
- return Success;
+ return BadValue;
}
buf = (char *)xalloc(total_length);
- if (!buf) {
- SendErrorToClient(client, IReqCode, X_GetDeviceControl, 0, BadAlloc);
- return Success;
- }
+ if (!buf)
+ return BadAlloc;
savbuf = buf;
switch (stuff->control) {