diff options
author | Cyril Roelandt <tipecaml@gmail.com> | 2012-12-17 00:51:25 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-12-17 01:19:21 +0100 |
commit | 03572bbcca89fa3034e4afe97818fc95284afadf (patch) | |
tree | e0ca3e378d5935f81dbe26c57fbff65d6c825899 | |
parent | e03db4ea34abce2ed0a8cc4410278e1290b9fd34 (diff) |
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.
-rw-r--r-- | console-client/kbd-repeat.c | 9 |
1 files 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)]; |