Changed to do not print error logs when last_error is already set. 86/231086/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Thu, 9 Apr 2020 09:13:15 +0000 (18:13 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Mon, 13 Apr 2020 08:07:04 +0000 (17:07 +0900)
Change-Id: Ib5b4ec852930a55089864eeaf28e7b095295bc50
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c

index 4f6acf172324f31a08a47687f31c6fb131c29976..48c9507a73627a7524dfba9feb1d1e33e11ee44d 100755 (executable)
@@ -81,6 +81,7 @@ struct _twe_wl_disp_source {
        twe_thread *thread;
        GMutex wl_event_mutex;
 
+       int last_error; /* errno of the last wl_display error*/
        /* TODO : surface list */
 };
 
@@ -606,6 +607,9 @@ _twe_display_print_err(twe_wl_disp_source *disp_source,
        char buf[1024];
        strerror_r(errno, buf, sizeof(buf));
 
+       if (disp_source->last_error == errno)
+               return;
+
        TPL_ERR("falied to %s. error:%d(%s)", func_name, errno, buf);
 
        dpy_err = wl_display_get_error(disp_source->disp);
@@ -618,6 +622,8 @@ _twe_display_print_err(twe_wl_disp_source *disp_source,
                TPL_ERR("[Protocol Error] interface: %s, error_code: %d, proxy_id: %d",
                                err_interface->name, err_code, err_proxy_id);
        }
+
+       disp_source->last_error = errno;
 }
 
 static gboolean
@@ -1000,6 +1006,7 @@ twe_display_add(twe_thread* thread,
        }
 
        source->disp = display;
+       source->last_error = 0;
        source->ev_queue = ev_queue;
        source->wl_tbm_client = wl_tbm_client;
        source->prepared = TPL_FALSE;