summaryrefslogtreecommitdiff
path: root/password.c
diff options
context:
space:
mode:
authorIan Fan <ianfan0@gmail.com>2018-10-23 11:46:51 +0100
committerIan Fan <ianfan0@gmail.com>2018-10-23 11:49:33 +0100
commit274179a804e67e0f191312350c52c10778c6e5c7 (patch)
tree4d86b27135cb5eab2aebb95eaa73de1a48fa8714 /password.c
parent4b312c1389ebc2ec73612bb4b9b4e7ea5f844f50 (diff)
swaylock: exit on display error
Diffstat (limited to 'password.c')
-rw-r--r--password.c6
1 files changed, 5 insertions, 1 deletions
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 <assert.h>
+#include <errno.h>
#include <pwd.h>
#include <stdlib.h>
#include <string.h>
@@ -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;