+ }
+ if (ret == 0) {
+ pthread_mutex_unlock(&file->getc_mutex);
+ return LIBALTOS_TIMEOUT;
+ }
+ if (fd[0].revents & POLLIN) {
+ ret = read(file->fd, file->in_data, USB_BUF_SIZE);
+ if (ret < 0) {
+ perror("altos_getchar");
+ pthread_mutex_unlock(&file->getc_mutex);
+ return LIBALTOS_ERROR;
+ }
+ file->in_read = 0;
+ file->in_used = ret;
+ }