Commit dab55a86 authored by Alessandro Rubini's avatar Alessandro Rubini

wr_mon: trivial fix for the unlikely non-tty case

termio setup is restored at exit; si save it initially even if we are
not going to modify it.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 2803160c
......@@ -19,12 +19,12 @@ void term_restore(void)
void term_init(int usecolor)
{
term_usecolor = usecolor;
tcgetattr(STDIN_FILENO,&oldkey); /* save it soon, for term_restore() */
if (!isatty(STDIN_FILENO) || !isatty(STDOUT_FILENO))
return;
return;
tcgetattr(STDIN_FILENO,&oldkey);
newkey = oldkey;
cfmakeraw(&newkey);
newkey.c_oflag |= OPOST; /* don't require \r in source files */
......
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