From 03572bbcca89fa3034e4afe97818fc95284afadf Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Mon, 17 Dec 2012 00:51:25 +0100 Subject: Fix double call to pthread_mutex_unlock in kbd_repeat_key(). * console-client/kbd-repeat.c (kbd_repeat_key): remove a redundant call to pthread_mutex_unlock. --- console-client/kbd-repeat.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/console-client/kbd-repeat.c b/console-client/kbd-repeat.c index ddfd1cf4..e45902d7 100644 --- a/console-client/kbd-repeat.c +++ b/console-client/kbd-repeat.c @@ -69,12 +69,9 @@ kbd_repeat_key (kd_event *key) pthread_mutex_lock (&global_lock); while (kbdbuf.size + sizeof (kd_event) > KBDBUFSZ) { - /* The input buffer is full, wait until there is some space. */ - if (pthread_hurd_cond_wait_np (&kbdbuf.writecond, &global_lock)) - { - pthread_mutex_unlock (&global_lock); - /* Interrupt, silently continue. */ - } + /* The input buffer is full, wait until there is some space. If this call + * is interrupted, silently continue. */ + (void) pthread_hurd_cond_wait_np (&kbdbuf.writecond, &global_lock); } ev = (kd_event *) &kbdbuf.keybuffer[KBDBUF_POS (kbdbuf.pos + kbdbuf.size)]; -- cgit v1.2.3