From 0b6d65431501f019fb9eec0d1bbde0a846fe01de Mon Sep 17 00:00:00 2001 From: Ali Gholami Rudi Date: Tue, 27 Oct 2009 16:17:21 +0330 Subject: [PATCH] make sigstop work --- fbff.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fbff.c b/fbff.c index a5a9db4..e8ba404 100644 --- a/fbff.c +++ b/fbff.c @@ -9,6 +9,7 @@ */ #include #include +#include #include #include #include @@ -283,7 +284,8 @@ static void term_setup(void) struct termios newtermios; tcgetattr(STDIN_FILENO, &termios); newtermios = termios; - cfmakeraw(&newtermios); + newtermios.c_lflag &= ~ICANON; + newtermios.c_lflag &= ~ECHO; tcsetattr(STDIN_FILENO, TCSAFLUSH, &newtermios); fcntl(STDIN_FILENO, F_SETFL, fcntl(STDIN_FILENO, F_GETFL) | O_NONBLOCK); } @@ -293,6 +295,11 @@ static void term_cleanup(void) tcsetattr(STDIN_FILENO, 0, &termios); } +static void sigcont(int sig) +{ + term_setup(); +} + static void read_args(int argc, char *argv[]) { int i = 1; @@ -341,6 +348,7 @@ int main(int argc, char *argv[]) } term_setup(); + signal(SIGCONT, sigcont); read_frames(); term_cleanup(); -- 2.11.4.GIT