summary refs log tree commit diff homepage
path: root/2048.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-12-31 22:38:34 -0500
committerJune McEnroe <june@causal.agency>2018-12-31 22:38:34 -0500
commitae39d0abf365e2e25dc56a45cc1d7ba0af0df67d (patch)
treeae67f726a10a85f21f0a8df041ee69fc1becfd8a /2048.c
parentReplace control chars with blanks in name (diff)
downloadplay-ae39d0abf365e2e25dc56a45cc1d7ba0af0df67d.tar.gz
play-ae39d0abf365e2e25dc56a45cc1d7ba0af0df67d.zip
Handle ERR from getch
Somehow, play processes were being orphaned without receiving SIGHUP and
would consume 100% CPU in this getch loop. I still have no idea what was
happening to the SSH sessions to cause orphans like that, but this at
least makes them exit.
Diffstat (limited to '2048.c')
-rw-r--r--2048.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/2048.c b/2048.c
index 9b8a3a4..fe17a30 100644
--- a/2048.c
+++ b/2048.c
@@ -240,6 +240,7 @@ static bool input(void) {
 		break; case 'k': case KEY_UP: if (up()) spawn();
 		break; case 'l': case KEY_RIGHT: if (right()) spawn();
 		break; case 'q': return false;
+		break; case ERR: exit(EXIT_FAILURE);
 	}
 	return true;
 }