Permalink
Browse files

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

  • Loading branch information...
1 parent ec29292 commit 5ab83eae7e1a825a2379b9ca35868b95cb6cec21 @nelhage committed Dec 14, 2008
Showing with 3 additions and 2 deletions.
  1. +3 −2 bconsole.c
View
@@ -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);
}

0 comments on commit 5ab83ea

Please sign in to comment.