Mesa (master): egl: Always record error code.

Chia-I Wu olv at kemper.freedesktop.org
Wed Feb 17 12:00:46 UTC 2010


Module: Mesa
Branch: master
Commit: 3dee01a692796496b6e3d6ff6e4ebac10b594640
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3dee01a692796496b6e3d6ff6e4ebac10b594640

Author: Chia-I Wu <olv at lunarg.com>
Date:   Wed Feb 17 16:42:30 2010 +0800

egl: Always record error code.

The error code denotes the success or failure of the most recent
function call.  A call to _eglError should always update the error code.

---

 src/egl/main/eglcurrent.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/egl/main/eglcurrent.c b/src/egl/main/eglcurrent.c
index 989c19a..c697bf7 100644
--- a/src/egl/main/eglcurrent.c
+++ b/src/egl/main/eglcurrent.c
@@ -248,19 +248,20 @@ _eglGetCurrentContext(void)
 
 
 /**
- * Record EGL error code.
+ * Record EGL error code and return EGL_FALSE.
  */
 EGLBoolean
 _eglError(EGLint errCode, const char *msg)
 {
    _EGLThreadInfo *t = _eglGetCurrentThread();
-   const char *s;
 
    if (t == &dummy_thread)
       return EGL_FALSE;
 
-   if (t->LastError == EGL_SUCCESS) {
-      t->LastError = errCode;
+   t->LastError = errCode;
+
+   if (errCode != EGL_SUCCESS) {
+      const char *s;
 
       switch (errCode) {
       case EGL_BAD_ACCESS:




More information about the mesa-commit mailing list