[PATCH (alt)] DRI2: Don't return bogus data when driverType is unrecognized
Aaron Plattner
aplattner at nvidia.com
Thu Oct 15 11:56:46 PDT 2009
Instead, just return a failure reply. Returning BadValue would change the ABI.
Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
---
This patch preserves the ABI by returning a valid failure reply instead of
BadValue.
hw/xfree86/dri2/dri2.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index d15ced1..79c2e57 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -387,7 +387,9 @@ DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd,
return FALSE;
if (driverType != DRI2DriverDRI)
- return BadValue;
+ /* This should be BadValue, but there's no way to return a Status here
+ * without changing the ABI */
+ return FALSE;
*fd = ds->fd;
*driverName = ds->driverName;
--
1.6.0.4
More information about the xorg-devel
mailing list