From 274179a804e67e0f191312350c52c10778c6e5c7 Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Tue, 23 Oct 2018 11:46:51 +0100 Subject: swaylock: exit on display error --- password.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'password.c') diff --git a/password.c b/password.c index fecaecb..6138e1f 100644 --- a/password.c +++ b/password.c @@ -1,5 +1,6 @@ #define _XOPEN_SOURCE 500 #include +#include #include #include #include @@ -97,7 +98,10 @@ void swaylock_handle_key(struct swaylock_state *state, state->eventloop, 50, handle_preverify_timeout, state); while (state->run_display && state->verify_password_timer) { - wl_display_flush(state->display); + errno = 0; + if (wl_display_flush(state->display) == -1 && errno != EAGAIN) { + break; + } loop_poll(state->eventloop); bool ok = 1; -- cgit v1.2.3