GNU/Linux: Fix AckBtn driver, again.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka
2021-02-17 10:12:08 +09:00
parent 8c48b0d7d3
commit 68b78a0ade

View File

@@ -79,6 +79,8 @@ user_interaction (void *arg)
pollfds[1].fd = event_fd; pollfds[1].fd = event_fd;
pollfds[1].events = POLLIN; pollfds[1].events = POLLIN;
fputs ("User interaction thread for AckBtn started.\n", stdout);
while (1) while (1)
{ {
unsigned int acked_or_timeout = 0; unsigned int acked_or_timeout = 0;
@@ -89,8 +91,6 @@ user_interaction (void *arg)
pthread_cond_wait (&cond, &mutex); pthread_cond_wait (&cond, &mutex);
pthread_mutex_unlock (&mutex); pthread_mutex_unlock (&mutex);
fputs ("User interaction for AckBtn started.\n", stdout);
/* Consume all input if any. */ /* Consume all input if any. */
while (1) while (1)
{ {
@@ -116,6 +116,7 @@ user_interaction (void *arg)
} }
fputs ("Type RET to acknowledge (or wait for timeout) > ", stdout); fputs ("Type RET to acknowledge (or wait for timeout) > ", stdout);
fflush (stdout);
while (!acked_or_timeout) while (!acked_or_timeout)
{ {