From bc24716476187453e61038eee6ed24f3d0821733 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Tue, 14 Jan 2020 19:54:48 +0100 Subject: [PATCH] wayland: errno does not have to be cleared As long as errno is only read on error from an errno-setting function, then there is no need to reset errno between uses. --- glfw/wl_window.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/glfw/wl_window.c b/glfw/wl_window.c index e82fda793..61b407dd8 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -763,7 +763,6 @@ handleEvents(monotonic_t timeout) while (wl_display_prepare_read(display) != 0) { while(1) { - errno = 0; int num_dispatched = wl_display_dispatch_pending(display); if (num_dispatched < 0) { if (errno == EAGAIN) continue; @@ -778,7 +777,6 @@ handleEvents(monotonic_t timeout) // If an error different from EAGAIN happens, we have likely been // disconnected from the Wayland session, try to handle that the best we // can. - errno = 0; if (wl_display_flush(display) < 0 && errno != EAGAIN) { wl_display_cancel_read(display);