diff options
author | Ian Fan <ianfan0@gmail.com> | 2018-10-23 11:46:51 +0100 |
---|---|---|
committer | Ian Fan <ianfan0@gmail.com> | 2018-10-23 11:49:33 +0100 |
commit | ebfb1388e2b178ecee1c1e1f4b5160af0efe2db6 (patch) | |
tree | f6242e2d098774e20618542bfeff411d0a75d79b /swaylock/password.c | |
parent | swaylock: exit early if unable to inhibit input (diff) | |
download | sway-ebfb1388e2b178ecee1c1e1f4b5160af0efe2db6.tar.gz sway-ebfb1388e2b178ecee1c1e1f4b5160af0efe2db6.tar.zst sway-ebfb1388e2b178ecee1c1e1f4b5160af0efe2db6.zip |
swaylock: exit on display error
Diffstat (limited to 'swaylock/password.c')
-rw-r--r-- | swaylock/password.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/swaylock/password.c b/swaylock/password.c index fecaecbf..6138e1fe 100644 --- a/swaylock/password.c +++ b/swaylock/password.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #define _XOPEN_SOURCE 500 | 1 | #define _XOPEN_SOURCE 500 |
2 | #include <assert.h> | 2 | #include <assert.h> |
3 | #include <errno.h> | ||
3 | #include <pwd.h> | 4 | #include <pwd.h> |
4 | #include <stdlib.h> | 5 | #include <stdlib.h> |
5 | #include <string.h> | 6 | #include <string.h> |
@@ -97,7 +98,10 @@ void swaylock_handle_key(struct swaylock_state *state, | |||
97 | state->eventloop, 50, handle_preverify_timeout, state); | 98 | state->eventloop, 50, handle_preverify_timeout, state); |
98 | 99 | ||
99 | while (state->run_display && state->verify_password_timer) { | 100 | while (state->run_display && state->verify_password_timer) { |
100 | wl_display_flush(state->display); | 101 | errno = 0; |
102 | if (wl_display_flush(state->display) == -1 && errno != EAGAIN) { | ||
103 | break; | ||
104 | } | ||
101 | loop_poll(state->eventloop); | 105 | loop_poll(state->eventloop); |
102 | 106 | ||
103 | bool ok = 1; | 107 | bool ok = 1; |