diff options
Diffstat (limited to 'console-client/kbd-repeat.c')
-rw-r--r-- | console-client/kbd-repeat.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/console-client/kbd-repeat.c b/console-client/kbd-repeat.c index 641520ca..d3a39d07 100644 --- a/console-client/kbd-repeat.c +++ b/console-client/kbd-repeat.c @@ -86,8 +86,11 @@ kbd_repeat_key (kd_event *key) static error_t repeater_select (struct protid *cred, mach_port_t reply, - mach_msg_type_name_t replytype, int *type) + mach_msg_type_name_t replytype, + struct timespec *tsp, int *type) { + error_t err; + if (!cred) return EOPNOTSUPP; @@ -109,12 +112,16 @@ repeater_select (struct protid *cred, mach_port_t reply, } ports_interrupt_self_on_port_death (cred, reply); - if (pthread_hurd_cond_wait_np (&select_alert, &global_lock)) + err = pthread_hurd_cond_timedwait_np (&select_alert, &global_lock, tsp); + if (err) { *type = 0; pthread_mutex_unlock (&global_lock); - return EINTR; + if (err == ETIMEDOUT) + err = 0; + + return err; } } } |