Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bconsole.c: Squash a warning about ignoring the return value of read()

  • Loading branch information...
commit 5ab83eae7e1a825a2379b9ca35868b95cb6cec21 1 parent ec29292
@nelhage authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 bconsole.c
View
5 bconsole.c
@@ -28,8 +28,9 @@ void* console_process(void *arg UNUSED) {
}
LOG("Keyboard interrupt!\n");
pthread_mutex_lock(&console_mutex);
- set_interrupt(INT_KBD);
- read(0, &kbd_char, 1);
+ if(read(0, &kbd_char, 1) > 0) {
+ set_interrupt(INT_KBD);
+ }
pthread_cond_wait(&console_cond, &console_mutex);
pthread_mutex_unlock(&console_mutex);
}
Please sign in to comment.
Something went wrong with that request. Please try again.