summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglsync.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main/eglsync.c')
-rw-r--r--src/egl/main/eglsync.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/egl/main/eglsync.c b/src/egl/main/eglsync.c
index f3250319dcc..6f779921caf 100644
--- a/src/egl/main/eglsync.c
+++ b/src/egl/main/eglsync.c
@@ -41,7 +41,7 @@
static EGLint
_eglParseSyncAttribList(_EGLSync *sync, const EGLint *attrib_list)
{
- EGLint i, err = EGL_SUCCESS;
+ EGLint i;
if (!attrib_list)
return EGL_SUCCESS;
@@ -49,6 +49,7 @@ _eglParseSyncAttribList(_EGLSync *sync, const EGLint *attrib_list)
for (i = 0; attrib_list[i] != EGL_NONE; i++) {
EGLint attr = attrib_list[i++];
EGLint val = attrib_list[i];
+ EGLint err = EGL_SUCCESS;
switch (attr) {
default:
@@ -59,18 +60,18 @@ _eglParseSyncAttribList(_EGLSync *sync, const EGLint *attrib_list)
if (err != EGL_SUCCESS) {
_eglLog(_EGL_DEBUG, "bad sync attribute 0x%04x", attr);
- break;
+ return err;
}
}
- return err;
+ return EGL_SUCCESS;
}
static EGLint
_eglParseSyncAttribList64(_EGLSync *sync, const EGLAttrib *attrib_list)
{
- EGLint i, err = EGL_SUCCESS;
+ EGLint i;
if (!attrib_list)
return EGL_SUCCESS;
@@ -78,6 +79,7 @@ _eglParseSyncAttribList64(_EGLSync *sync, const EGLAttrib *attrib_list)
for (i = 0; attrib_list[i] != EGL_NONE; i++) {
EGLAttrib attr = attrib_list[i++];
EGLAttrib val = attrib_list[i];
+ EGLint err = EGL_SUCCESS;
switch (attr) {
case EGL_CL_EVENT_HANDLE_KHR:
@@ -94,11 +96,11 @@ _eglParseSyncAttribList64(_EGLSync *sync, const EGLAttrib *attrib_list)
if (err != EGL_SUCCESS) {
_eglLog(_EGL_DEBUG, "bad sync attribute 0x%" PRIxPTR, attr);
- break;
+ return err;
}
}
- return err;
+ return EGL_SUCCESS;
}