Skip to content
Commit 12cea955 authored by Neil Roberts's avatar Neil Roberts Committed by Kristian Høgsberg
Browse files

wayland-client: Treat EOF when reading the wayland socket as an error

If EOF is encountered while reading from the Wayland socket, make
wl_display_read_events() return -1 so that it will be treated as an
error. The documentation for this function states that it will set
errno when there is an error so it additionally makes up an errno of
EPIPE.

If we don't do this then when the compositor quits the Wayland socket
will be become ready for reading but wl_display_dispatch will do
nothing which typically makes the application take up 100% CPU. In
particular eglSwapBuffers will likely get stuck in an infinite busy
loop because it repeatedly calls wl_display_dispatch_queue while it
waits for the frame callback.

https://bugzilla.gnome.org/show_bug.cgi?id=703892
parent 4cffa0fd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment