[mutter] egl: Don't set an error when there is none



commit 719a6c0006ed5e982b283c9a616973600db8c7f7
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Wed Jan 12 14:02:25 2022 +0100

    egl: Don't set an error when there is none
    
    Some API will return NULL or the equivalent; sometimes it's an error,
    and sometimes it's not, and the way to check that is by looking at the
    return value of eglGetError(). When we check this, don't set the GError
    if it returned EGL_SUCCESS, as that indicates that the return value is
    expected behavior, and not an error.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2151>

 src/backends/meta-egl.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/backends/meta-egl.c b/src/backends/meta-egl.c
index 0563b55b57..8adc2407e7 100644
--- a/src/backends/meta-egl.c
+++ b/src/backends/meta-egl.c
@@ -159,6 +159,9 @@ set_egl_error (GError **error)
     return;
 
   error_number = eglGetError ();
+  if (error_number == EGL_SUCCESS)
+    return;
+
   error_str = get_egl_error_str (error_number);
   g_set_error_literal (error, META_EGL_ERROR,
                        error_number,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]