diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-14 12:28:38 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-15 00:26:27 +1000 |
commit | 6921fdc6d6134fd7aaf38ffc1686623eca9bbd18 (patch) | |
tree | 0cbafde1d61ba4282e3ca73b4a312b9e82db25f9 /swaylock/password.c | |
parent | f98f351a5275967c46482e1c9c754fee927d72ee (diff) |
Remove timerfd from loop implementation
timerfd doesn't work on the BSDs, so this replaces it with a timespec
for the expiry and uses a poll timeout to check the timers when needed.
Diffstat (limited to 'swaylock/password.c')
-rw-r--r-- | swaylock/password.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/swaylock/password.c b/swaylock/password.c index 3f9949b2..fecaecbf 100644 --- a/swaylock/password.c +++ b/swaylock/password.c @@ -40,7 +40,7 @@ static void append_ch(struct swaylock_password *pw, uint32_t codepoint) { pw->len += utf8_size; } -static void clear_indicator(int fd, short mask, void *data) { +static void clear_indicator(void *data) { struct swaylock_state *state = data; state->clear_indicator_timer = NULL; state->auth_state = AUTH_STATE_IDLE; @@ -49,13 +49,13 @@ static void clear_indicator(int fd, short mask, void *data) { static void schedule_indicator_clear(struct swaylock_state *state) { if (state->clear_indicator_timer) { - loop_remove_event(state->eventloop, state->clear_indicator_timer); + loop_remove_timer(state->eventloop, state->clear_indicator_timer); } state->clear_indicator_timer = loop_add_timer( state->eventloop, 3000, clear_indicator, state); } -static void clear_password(int fd, short mask, void *data) { +static void clear_password(void *data) { struct swaylock_state *state = data; state->clear_password_timer = NULL; state->auth_state = AUTH_STATE_CLEAR; @@ -66,13 +66,13 @@ static void clear_password(int fd, short mask, void *data) { static void schedule_password_clear(struct swaylock_state *state) { if (state->clear_password_timer) { - loop_remove_event(state->eventloop, state->clear_password_timer); + loop_remove_timer(state->eventloop, state->clear_password_timer); } state->clear_password_timer = loop_add_timer( state->eventloop, 10000, clear_password, state); } -static void handle_preverify_timeout(int fd, short mask, void *data) { +static void handle_preverify_timeout(void *data) { struct swaylock_state *state = data; state->verify_password_timer = NULL; } |