diff options
author | Jamey Sharp <jamey@minilop.net> | 2010-04-24 23:26:40 -0700 |
---|---|---|
committer | Jamey Sharp <jamey@minilop.net> | 2010-05-19 12:32:48 -0700 |
commit | e291c561821ae86b7dd74269d5cd29bc31703962 (patch) | |
tree | 5b4c5b1448c6b08bd4cb6712eb6314e29f8e591f /Xi | |
parent | 90e612dcbe370da095d317fac62c80ac2447fa0b (diff) |
Return an appropriately-typed error from dixLookupResourceByType.
Rather than always returning BadValue, associate an error status like
BadWindow with a resource type like RT_WINDOW, and return the
appropriate one for the requested type.
This patch only touches the core protocol resource types. Others still
return BadValue and need to be mapped appropriately.
dixLookupResourceByType can now return BadImplementation, if the caller
asked for a resource type that has not been allocated in the server.
Signed-off-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 4 | ||||
-rw-r--r-- | Xi/xichangecursor.c | 2 | ||||
-rw-r--r-- | Xi/xipassivegrab.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index b24204d82..41b396c28 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1445,7 +1445,7 @@ GrabButton(ClientPtr client, DeviceIntPtr dev, DeviceIntPtr modifier_device, if (rc != Success) { client->errorValue = param->cursor; - return (rc == BadValue) ? BadCursor : rc; + return rc; } access_mode |= DixForceAccess; } @@ -1543,7 +1543,7 @@ GrabWindow(ClientPtr client, DeviceIntPtr dev, int type, if (rc != Success) { client->errorValue = param->cursor; - return (rc == BadValue) ? BadCursor : rc; + return rc; } access_mode |= DixForceAccess; } diff --git a/Xi/xichangecursor.c b/Xi/xichangecursor.c index f071e8406..e72cfac03 100644 --- a/Xi/xichangecursor.c +++ b/Xi/xichangecursor.c @@ -103,7 +103,7 @@ int ProcXIChangeCursor(ClientPtr client) rc = dixLookupResourceByType((pointer *)&pCursor, stuff->cursor, RT_CURSOR, client, DixUseAccess); if (rc != Success) - return (rc == BadValue) ? BadCursor : rc; + return rc; } ChangeWindowDeviceCursor(pWin, pDev, pCursor); diff --git a/Xi/xipassivegrab.c b/Xi/xipassivegrab.c index a62fe7946..296614510 100644 --- a/Xi/xipassivegrab.c +++ b/Xi/xipassivegrab.c @@ -147,7 +147,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) if (status != Success) { client->errorValue = stuff->cursor; - return (status == BadValue) ? BadCursor : status; + return status; } } |