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.
This commit is contained in:
Kenny Levinsen 2020-01-14 19:54:48 +01:00
parent 4acab65016
commit bc24716476

2
glfw/wl_window.c vendored
View File

@ -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);