summaryrefslogtreecommitdiff
path: root/src/egl/main/eglcurrent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main/eglcurrent.c')
-rw-r--r--src/egl/main/eglcurrent.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/egl/main/eglcurrent.c b/src/egl/main/eglcurrent.c
index 989c19a2fa..c697bf796d 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: