Commit 28d0ff71 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Fix the same basic error in all our curses programs: When the

stdin-fd is dead, it takes more than "break;" to get out of a
switch-in-a-loop.
parent 00707a9a
......@@ -397,6 +397,7 @@ do_curses(void *arg)
timeout(delay * 1000);
switch ((ch = getch())) {
case ERR:
quit = 1;
break;
#ifdef KEY_RESIZE
case KEY_RESIZE:
......
......@@ -1030,6 +1030,7 @@ do_curses(struct vsm *vsm, struct vsc *vsc, double delay)
switch (ch = wgetch(w_status)) {
case ERR:
keep_running = 0;
break;
#ifdef KEY_RESIZE /* sigh, Solaris lacks this.. */
case KEY_RESIZE:
......
......@@ -271,14 +271,15 @@ do_curses(void *arg)
AC(intrflush(stdscr, FALSE));
(void)curs_set(0);
AC(erase());
timeout(1000);
while (!quit) {
AZ(pthread_mutex_lock(&mtx));
update(period);
AZ(pthread_mutex_unlock(&mtx));
timeout(1000);
switch (getch()) {
case ERR:
quit = 1;
break;
#ifdef KEY_RESIZE
case KEY_RESIZE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment