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/selectev.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/selectev.c')
-rw-r--r-- | Xi/selectev.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/Xi/selectev.c b/Xi/selectev.c index d52db1b81..a5cf56754 100644 --- a/Xi/selectev.c +++ b/Xi/selectev.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 structure */ #include <X11/extensions/XI.h> #include <X11/extensions/XIproto.h> -#include "extnsionst.h" #include "extinit.h" /* LookupDeviceIntRec */ #include "exevents.h" #include "exglobals.h" @@ -164,40 +161,29 @@ ProcXSelectExtensionEvent(ClientPtr client) REQUEST(xSelectExtensionEventReq); REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq); - if (stuff->length != (sizeof(xSelectExtensionEventReq) >> 2) + stuff->count) { - SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0, - BadLength); - return Success; - } + if (stuff->length != (sizeof(xSelectExtensionEventReq) >> 2) + stuff->count) + return BadLength; ret = dixLookupWindow(&pWin, stuff->window, client, DixUnknownAccess); - if (ret != Success) { - SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0, ret); - return Success; - } + if (ret != Success) + return ret; if (HandleDevicePresenceMask(client, pWin, (XEventClass *) & stuff[1], - &stuff->count) != Success) { - SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0, - BadAlloc); - return Success; - } + &stuff->count) != Success) + return BadAlloc; if ((ret = CreateMaskFromList(client, (XEventClass *) & stuff[1], stuff->count, tmp, NULL, X_SelectExtensionEvent)) != Success) - return Success; + return ret; for (i = 0; i < EMASKSIZE; i++) if (tmp[i].dev != NULL) { if ((ret = SelectForWindow((DeviceIntPtr) tmp[i].dev, pWin, client, tmp[i].mask, ExtExclusiveMasks[i], - ExtValidMasks[i])) != Success) { - SendErrorToClient(client, IReqCode, X_SelectExtensionEvent, 0, - ret); - return Success; - } + ExtValidMasks[i])) != Success) + return ret; } return Success; |