diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2007-09-24 13:33:01 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@moss-charon.epoch.ncsc.mil> | 2007-09-26 07:26:59 -0400 |
commit | 31a7994ac7365562ef1d00e0a7b25f967a961a4e (patch) | |
tree | a2054c0e371e9c62396f2e09df469142dca0a633 /Xi/sendexev.c | |
parent | 56ffc381d32687242dd094395fcf2216339bab2a (diff) |
Input: Return errors to the dispatcher instead of sending them ourself.
Also fixed two "unused variable: stuff" warnings.
Diffstat (limited to 'Xi/sendexev.c')
-rw-r--r-- | Xi/sendexev.c | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/Xi/sendexev.c b/Xi/sendexev.c index eac9abe14..20b415a1f 100644 --- a/Xi/sendexev.c +++ b/Xi/sendexev.c @@ -57,13 +57,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 "windowstr.h" /* Window */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> -#include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exevents.h" #include "exglobals.h" @@ -131,38 +128,29 @@ ProcXSendExtensionEvent(ClientPtr client) REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq); if (stuff->length != (sizeof(xSendExtensionEventReq) >> 2) + stuff->count + - (stuff->num_events * (sizeof(xEvent) >> 2))) { - SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, BadLength); - return Success; - } + (stuff->num_events * (sizeof(xEvent) >> 2))) + return BadLength; dev = LookupDeviceIntRec(stuff->deviceid); - if (dev == NULL) { - SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, BadDevice); - return Success; - } + if (dev == NULL) + return BadDevice; /* The client's event type must be one defined by an extension. */ first = ((xEvent *) & stuff[1]); if (!((EXTENSION_EVENT_BASE <= first->u.u.type) && - (first->u.u.type < lastEvent))) { + (first->u.u.type < lastEvent))) client->errorValue = first->u.u.type; - SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, BadValue); - return Success; - } + return BadValue; list = (XEventClass *) (first + stuff->num_events); if ((ret = CreateMaskFromList(client, list, stuff->count, tmp, dev, X_SendExtensionEvent)) != Success) - return Success; + return ret; ret = (SendEvent(client, dev, stuff->destination, stuff->propagate, (xEvent *) & stuff[1], tmp[stuff->deviceid].mask, stuff->num_events)); - if (ret != Success) - SendErrorToClient(client, IReqCode, X_SendExtensionEvent, 0, ret); - - return Success; + return ret; } |