mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-15 07:04:31 +03:00
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:
parent
4acab65016
commit
bc24716476
2
glfw/wl_window.c
vendored
2
glfw/wl_window.c
vendored
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user