Skip to content

Commit

Permalink
Use TCSASOFT if available
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed May 31, 2015
1 parent 55df210 commit bbda01c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/pure-pw.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ static void disable_echo(void)
return;
}
p.c_lflag &= ~ECHO;
# ifndef TCSAFLUSH
# define TCSAFLUSH 0
# endif
# if defined(TCSASOFT) && defined(TCSAFLUSH)
tcsetattr(0, TCSASOFT | TCSAFLUSH, &p);
# elif defined(TCSAFLUSH)
tcsetattr(0, TCSAFLUSH, &p);
# endif
}
# elif defined(HAVE_TERMIO_H) && defined(TCGETA)
{
Expand Down Expand Up @@ -89,8 +90,10 @@ static void enable_echo(void)
return;
}
p.c_lflag |= ECHO;
# ifndef TCSAFLUSH
# define TCSAFLUSH 0
# if defined(TCSASOFT) && defined(TCSAFLUSH)
tcsetattr(0, TCSASOFT | TCSAFLUSH, &p);
# elif defined(TCSAFLUSH)
tcsetattr(0, TCSAFLUSH, &p);
# endif
tcsetattr(0, TCSAFLUSH, &p);
}
Expand Down

0 comments on commit bbda01c

Please sign in to comment.