From 5bd4b0624727137657029b47bf3d1e33ee22c1a4 Mon Sep 17 00:00:00 2001 From: thilo Date: Sat, 24 Oct 2009 12:01:29 +0000 Subject: Add SIGCONT signal handler to reinitialize console after doing CTRL+Z / fg, as under Linux/bash stdin seems to lose O_NONBLOCK flag as well as all tcsetattr() attributes after foregrounding git-svn-id: svn://svn.icculus.org/quake3/trunk@1701 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/sys/con_tty.c | 58 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 22 deletions(-) (limited to 'code/sys') diff --git a/code/sys/con_tty.c b/code/sys/con_tty.c index f65f5f7..c70db69 100644 --- a/code/sys/con_tty.c +++ b/code/sys/con_tty.c @@ -70,7 +70,7 @@ FIXME relevant? static void CON_FlushIn( void ) { char key; - while (read(0, &key, 1)!=-1); + while (read(STDIN_FILENO, &key, 1)!=-1); } /* @@ -90,11 +90,11 @@ static void CON_Back( void ) size_t size; key = '\b'; - size = write(1, &key, 1); + size = write(STDOUT_FILENO, &key, 1); key = ' '; - size = write(1, &key, 1); + size = write(STDOUT_FILENO, &key, 1); key = '\b'; - size = write(1, &key, 1); + size = write(STDOUT_FILENO, &key, 1); } /* @@ -146,12 +146,12 @@ static void CON_Show( void ) if (ttycon_hide == 0) { size_t size; - size = write( 1, "]", 1 ); + size = write(STDOUT_FILENO, "]", 1); if (TTY_con.cursor) { for (i=0; i