From c3124494227a230ae992b5c356fcff659757f91d Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Sat, 24 Oct 2009 12:01:29 +0000 Subject: [PATCH] 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 --- code/sys/con_tty.c | 58 ++++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/code/sys/con_tty.c b/code/sys/con_tty.c index f65f5f76..c70db698 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